[f-spot] port EditTagIconDialog to GtkBuilder



commit 842aaedbb6ee059540d073a32246df5a6d0f5d94
Author: Stephane Delcroix <stephane delcroix org>
Date:   Fri Jul 10 15:01:24 2009 +0200

    port EditTagIconDialog to GtkBuilder

 src/Makefile.am                       |    2 +
 src/TagCommands.cs                    |  243 ----------------------------
 src/UI.Dialog/EditTagDialog.cs        |   32 +++--
 src/UI.Dialog/EditTagIconDialog.cs    |  231 +++++++++++++++++++++++++++
 src/UI.Dialog/ui/EditTagIconDialog.ui |  280 +++++++++++++++++++++++++++++++++
 src/f-spot.glade                      |  259 ------------------------------
 src/main.cs                           |    3 +
 7 files changed, 537 insertions(+), 513 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index c28eed7..040e20f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -258,6 +258,7 @@ F_SPOT_CSDISTFILES =				\
 	$(srcdir)/UI.Dialog/DateRangeDialog.cs		\
 	$(srcdir)/UI.Dialog/EditExceptionDialog.cs	\
 	$(srcdir)/UI.Dialog/EditTagDialog.cs	\
+	$(srcdir)/UI.Dialog/EditTagIconDialog.cs	\
 	$(srcdir)/UI.Dialog/ExceptionDialog.cs	\
 	$(srcdir)/UI.Dialog/GladeDialog.cs	\
 	$(srcdir)/UI.Dialog/HigMessageDialog.cs	\
@@ -409,6 +410,7 @@ F_SPOT_DISTRESOURCES =					\
 	$(srcdir)/UI.Dialog/ui/AdjustTimeDialog.ui	\
 	$(srcdir)/UI.Dialog/ui/DateRangeDialog.ui	\
 	$(srcdir)/UI.Dialog/ui/EditTagDialog.ui		\
+	$(srcdir)/UI.Dialog/ui/EditTagIconDialog.ui		\
 	$(srcdir)/UI.Dialog/ui/PreferenceDialog.glade	\
 	$(srcdir)/FSpot.addin.xml
 
diff --git a/src/TagCommands.cs b/src/TagCommands.cs
index aa47dda..6a297b5 100644
--- a/src/TagCommands.cs
+++ b/src/TagCommands.cs
@@ -181,247 +181,4 @@ public class TagCommands {
 		}
 	}
 
-	public class EditIcon : GladeDialog {
-		Db db;
-		Gtk.Window parent_window;
-		FSpot.PhotoQuery query;
-		PhotoImageView image_view;
-		Gtk.IconView icon_view;
-		ListStore icon_store;
-		string icon_name = null;
-		Gtk.FileChooserButton external_photo_chooser;
-
-
-		[Glade.Widget] Gtk.Image preview_image;
-		[Glade.Widget] ScrolledWindow photo_scrolled_window;
-		[Glade.Widget] ScrolledWindow icon_scrolled_window;
-		[Glade.Widget] Label photo_label;
-		[Glade.Widget] Label from_photo_label;
-		[Glade.Widget] Label from_external_photo_label;
-		[Glade.Widget] private Label predefined_icon_label;
-		[Glade.Widget] SpinButton photo_spin_button;
-		[Glade.Widget] HBox external_photo_chooser_hbox;
-		[Glade.Widget] Button noicon_button;
-		
-		private Gdk.Pixbuf PreviewPixbuf_WithoutProfile;
-
-		private Gdk.Pixbuf PreviewPixbuf {
-			get { return preview_image.Pixbuf; }
-			set {
-				icon_name = null;
-				preview_image.Pixbuf = value;
-			}
-
-		}
-
-		private string IconName {
-			get { return icon_name; }
-			set {
-				icon_name = value;	
-				preview_image.Pixbuf = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, value, 48, (IconLookupFlags) 0);
-			}
-			
-		}
-
-		public FSpot.BrowsablePointer Item {
-			get {
-				return image_view.Item;
-			}
-		}
-		
-		private void HandleSpinButtonChanged (object sender, EventArgs args)
-		{
-			int value = photo_spin_button.ValueAsInt - 1;
-			
-			image_view.Item.Index = value;
-		}
-
-		private void HandleExternalFileSelectionChanged (object sender, EventArgs args)
-		{	//Note: The filter on the FileChooserButton's dialog means that we will have a Pixbuf compatible uri here
-			CreateTagIconFromExternalPhoto ();
-		}
-
-		private void CreateTagIconFromExternalPhoto ()
-		{
-			try {
-				using (FSpot.ImageFile img = FSpot.ImageFile.Create(new Uri(external_photo_chooser.Uri))) {
-					using (Gdk.Pixbuf external_image = img.Load ()) {
-						PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (external_image);
-						PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
-						FSpot.ColorManagement.ApplyScreenProfile (PreviewPixbuf);
-					}
-				}
-			} catch (Exception) {
-				string caption = Catalog.GetString ("Unable to load image");
-				string message = String.Format (Catalog.GetString ("Unable to load \"{0}\" as icon for the tag"), 
-									external_photo_chooser.Uri.ToString ());
-				HigMessageDialog md = new HigMessageDialog (this.Dialog, 
-									    DialogFlags.DestroyWithParent,
-									    MessageType.Error,
-									    ButtonsType.Close,
-									    caption, 
-									    message);
-				md.Run();
-				md.Destroy();
-			}
-		}
-
-		private void HandleSelectionChanged (object sender, EventArgs e)
-		{
-		       	int x = image_view.Selection.X;
-		       	int y = image_view.Selection.Y;
-			int width = image_view.Selection.Width;
-			int height = image_view.Selection.Height;
-		       
-//			if (width > 0 && height > 0) 
-//				icon_view.Selection.Clear ();
-				
-			if (image_view.Pixbuf != null) {
-				if (width > 0 && height > 0) {
-					using (var tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height)) {	
-						//FIXME
-						PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (tmp);
-						PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
-						FSpot.ColorManagement.ApplyScreenProfile (PreviewPixbuf);
-					}
-				} else {
-					//FIXME
-					PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (image_view.Pixbuf);
-					PreviewPixbuf_WithoutProfile = PreviewPixbuf.Copy();
-					FSpot.ColorManagement.ApplyScreenProfile (PreviewPixbuf);
-				}
-			}
-		}
-
-		public void HandlePhotoChanged (object sender, EventArgs e)
-		{
-			int item = image_view.Item.Index;
-			photo_label.Text = String.Format (Catalog.GetString ("Photo {0} of {1}"), 
-							  item + 1, query.Count);
-
-			photo_spin_button.Value = item + 1;
-		}
-
-		public void HandleIconSelectionChanged (object o, EventArgs args)
-		{
-			if (icon_view.SelectedItems.Length == 0)
-				return;
-
-			TreeIter iter;
-			icon_store.GetIter (out iter, icon_view.SelectedItems [0]); 
-			IconName = (string) icon_store.GetValue (iter, 0);
-		}
-
-		public bool FillIconView ()
-		{
-			icon_store.Clear ();
-			string [] icon_list = FSpot.Global.IconTheme.ListIcons ("Emblems");
-			foreach (string item_name in icon_list)
-				icon_store.AppendValues (item_name, GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, item_name, 32, (IconLookupFlags) 0));
-			return false;
-		}
-
-
-		public bool Execute (Tag t)
-		{
-			this.CreateDialog ("edit_icon_dialog");
-
-			this.Dialog.Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);
-
-			PreviewPixbuf = t.Icon;
-
-			query = new FSpot.PhotoQuery (db.Photos);
-			
-			if (db.Tags.Hidden != null)
-				query.Terms = FSpot.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
-			else 
-				query.Terms = new FSpot.Literal (t);
-
-			image_view = new PhotoImageView (query);
-			image_view.SelectionXyRatio = 1.0;
-			image_view.SelectionChanged += HandleSelectionChanged;
-			image_view.PhotoChanged += HandlePhotoChanged;
-
-                        external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
-                                                                 Gtk.FileChooserAction.Open);
-
-			external_photo_chooser.Filter = new FileFilter();
-			external_photo_chooser.Filter.AddPixbufFormats();
-                        external_photo_chooser.LocalOnly = false;
-                        external_photo_chooser_hbox.PackStart (external_photo_chooser);
-
-    			Dialog.ShowAll ();
-			external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;
-
-			photo_scrolled_window.Add (image_view);
-
-			if (query.Count > 0) {
-				photo_spin_button.Wrap = true;
-				photo_spin_button.Adjustment.Lower = 1.0;
-				photo_spin_button.Adjustment.Upper = (double) query.Count;
-				photo_spin_button.Adjustment.StepIncrement = 1.0;
-				photo_spin_button.ValueChanged += HandleSpinButtonChanged;
-				
-				image_view.Item.Index = 0;
-			} else {
-				from_photo_label.Markup = String.Format (Catalog.GetString (
-					"\n<b>From Photo</b>\n" +
-					" You can use one of your library photos as an icon for this tag.\n" +
-					" However, first you must have at least one photo associated\n" +
-					" with this tag. Please tag a photo as '{0}' and return here\n" +
-					" to use it as an icon."), t.Name); 
-				photo_scrolled_window.Visible = false;
-				photo_label.Visible = false;
-				photo_spin_button.Visible = false;
-			}			
-
-			icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));
-
-			icon_view = new Gtk.IconView (icon_store); 
-			icon_view.PixbufColumn = 1;
-			icon_view.SelectionMode = SelectionMode.Single;
-			icon_view.SelectionChanged += HandleIconSelectionChanged;
-
-			icon_scrolled_window.Add (icon_view);
-
-			icon_view.Show();
-
-			image_view.Show ();
-
-			FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
-			fill_delay.Start ();
-
-			ResponseType response = (ResponseType) this.Dialog.Run ();
-			bool success = false;
-
-			if (response == ResponseType.Ok) {
-				try {
-					if (IconName != null) {
-						t.ThemeIconName = IconName;
-					} else {
-						t.ThemeIconName = null;
-						t.Icon = PreviewPixbuf_WithoutProfile;
-					}
-					//db.Tags.Commit (t);
-					success = true;
-				} catch (Exception ex) {
-					// FIXME error dialog.
-					Console.WriteLine ("error {0}", ex);
-				}
-			} else if (response == (ResponseType) (1)) {
-				t.Icon = null;
-				success = true;
-			}
-			
-			this.Dialog.Destroy ();
-			return success;
-		}
-
-		public EditIcon (Db db, Gtk.Window parent_window)
-		{
-			this.db = db;
-			this.parent_window = parent_window;
-		}
-	}
-
 }
diff --git a/src/UI.Dialog/EditTagDialog.cs b/src/UI.Dialog/EditTagDialog.cs
index 383bf18..b678b64 100644
--- a/src/UI.Dialog/EditTagDialog.cs
+++ b/src/UI.Dialog/EditTagDialog.cs
@@ -1,5 +1,5 @@
 /*
- * EditTagDialog.cs
+ * FSpot.UI.Dialog.EditTagDialog.cs
  *
  * Author(s):
  * 	Larry Ewing <lewing novell com>
@@ -13,7 +13,7 @@
 
 using System;
 using System.Collections;
-using Mono.Posix;
+using Mono.Unix;
 using Gtk;
 
 namespace FSpot.UI.Dialog
@@ -108,16 +108,26 @@ namespace FSpot.UI.Dialog
 
 		void HandleIconButtonClicked (object sender, EventArgs args)
 		{
-			TagCommands.EditIcon command = new TagCommands.EditIcon (db, this);
-			//FIXME
-			if (command.Execute (tag)) {
-				if (FSpot.ColorManagement.IsEnabled && tag.Icon != null) {
-					icon_image.Pixbuf = tag.Icon.Copy();
-					FSpot.ColorManagement.ApplyScreenProfile(icon_image.Pixbuf);
+			EditTagIconDialog dialog = new EditTagIconDialog (db, tag, this);
+
+			ResponseType response = (ResponseType) dialog.Run ();
+			if (response == ResponseType.Ok) {
+				if (dialog.ThemeIconName != null) {
+					tag.ThemeIconName = dialog.ThemeIconName;
+				} else {
+					tag.ThemeIconName = null;
+					tag.Icon = dialog.PreviewPixbuf;
 				}
-				else
-					icon_image.Pixbuf = tag.Icon;
-			}
+			} else if (response == (ResponseType)1)
+				tag.Icon = null;
+			
+			if (FSpot.ColorManagement.IsEnabled && tag.Icon != null) {
+				icon_image.Pixbuf = tag.Icon.Copy();
+				FSpot.ColorManagement.ApplyScreenProfile(icon_image.Pixbuf);
+			} else
+				icon_image.Pixbuf = tag.Icon;
+			
+			dialog.Destroy ();
 		}
 
 		void PopulateCategoryOptionMenu (Tag t)
diff --git a/src/UI.Dialog/EditTagIconDialog.cs b/src/UI.Dialog/EditTagIconDialog.cs
new file mode 100644
index 0000000..0390172
--- /dev/null
+++ b/src/UI.Dialog/EditTagIconDialog.cs
@@ -0,0 +1,231 @@
+/*
+ * FSpot.UI.Dialog.EditTagIconDialog.cs
+ *
+ * Author(s):
+ * 	Larry Ewing <lewing novell com>
+ * 	Stephane Delcroix <stephane delcroix org>
+ *
+ * Copyright (c) 2003-2009 Novell, Inc,
+ * Copyright (c) 2007 Stephane Delcroix <stephane delcroix org>
+ *
+ * This is free software. See COPYING for details
+ */
+
+using System;
+using Mono.Posix;
+using Gtk;
+using FSpot.Widgets;
+using FSpot.Utils;
+
+namespace FSpot.UI.Dialog
+{
+	public class EditTagIconDialog : BuilderDialog {
+		Db db;
+		FSpot.PhotoQuery query;
+		PhotoImageView image_view;
+		Gtk.IconView icon_view;
+		ListStore icon_store;
+		string icon_name = null;
+		Gtk.FileChooserButton external_photo_chooser;
+
+
+		[GtkBeans.Builder.Object] Gtk.Image preview_image;
+		[GtkBeans.Builder.Object] ScrolledWindow photo_scrolled_window;
+		[GtkBeans.Builder.Object] ScrolledWindow icon_scrolled_window;
+		[GtkBeans.Builder.Object] Label photo_label;
+		[GtkBeans.Builder.Object] Label from_photo_label;
+		[GtkBeans.Builder.Object] Label from_external_photo_label;
+		[GtkBeans.Builder.Object] private Label predefined_icon_label;
+		[GtkBeans.Builder.Object] SpinButton photo_spin_button;
+		[GtkBeans.Builder.Object] HBox external_photo_chooser_hbox;
+		[GtkBeans.Builder.Object] Button noicon_button;
+		
+		public EditTagIconDialog (Db db, Tag t, Gtk.Window parent_window) : base ("EditTagIconDialog.ui", "edit_tag_icon_dialog")
+		{
+			this.db = db;
+			TransientFor = parent_window;
+			Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);
+
+			preview_pixbuf = t.Icon;
+			if (preview_pixbuf != null && ColorManagement.IsEnabled) {
+				preview_image.Pixbuf = preview_pixbuf.Copy ();
+				ColorManagement.ApplyScreenProfile (preview_image.Pixbuf);
+			} else
+				preview_image.Pixbuf = preview_pixbuf;
+
+			query = new FSpot.PhotoQuery (db.Photos);
+			
+			if (db.Tags.Hidden != null)
+				query.Terms = FSpot.OrTerm.FromTags (new Tag []{ t, db.Tags.Hidden });
+			else 
+				query.Terms = new FSpot.Literal (t);
+
+			image_view = new PhotoImageView (query);
+			image_view.SelectionXyRatio = 1.0;
+			image_view.SelectionChanged += HandleSelectionChanged;
+			image_view.PhotoChanged += HandlePhotoChanged;
+
+                        external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
+                                                                 Gtk.FileChooserAction.Open);
+
+			external_photo_chooser.Filter = new FileFilter();
+			external_photo_chooser.Filter.AddPixbufFormats();
+                        external_photo_chooser.LocalOnly = false;
+                        external_photo_chooser_hbox.PackStart (external_photo_chooser);
+
+			external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;
+
+			photo_scrolled_window.Add (image_view);
+
+			if (query.Count > 0) {
+				photo_spin_button.Wrap = true;
+				photo_spin_button.Adjustment.Lower = 1.0;
+				photo_spin_button.Adjustment.Upper = (double) query.Count;
+				photo_spin_button.Adjustment.StepIncrement = 1.0;
+				photo_spin_button.ValueChanged += HandleSpinButtonChanged;
+				
+				image_view.Item.Index = 0;
+			} else {
+				from_photo_label.Markup = String.Format (Catalog.GetString (
+					"\n<b>From Photo</b>\n" +
+					" You can use one of your library photos as an icon for this tag.\n" +
+					" However, first you must have at least one photo associated\n" +
+					" with this tag. Please tag a photo as '{0}' and return here\n" +
+					" to use it as an icon."), t.Name); 
+				photo_scrolled_window.Visible = false;
+				photo_label.Visible = false;
+				photo_spin_button.Visible = false;
+			}			
+
+			icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));
+
+			icon_view = new Gtk.IconView (icon_store); 
+			icon_view.PixbufColumn = 1;
+			icon_view.SelectionMode = SelectionMode.Single;
+			icon_view.SelectionChanged += HandleIconSelectionChanged;
+
+			icon_scrolled_window.Add (icon_view);
+
+			icon_view.Show();
+
+			image_view.Show ();
+
+			FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
+			fill_delay.Start ();
+		}
+
+		public FSpot.BrowsablePointer Item {
+			get { return image_view.Item; }
+		}
+
+		Gdk.Pixbuf preview_pixbuf;
+		public Gdk.Pixbuf PreviewPixbuf {
+			get { return preview_pixbuf; }
+			set {
+				icon_name = null;
+				preview_pixbuf = value;
+				if (value != null && ColorManagement.IsEnabled) {
+					preview_image.Pixbuf = value.Copy ();
+					ColorManagement.ApplyScreenProfile (preview_image.Pixbuf);
+				} else
+					preview_image.Pixbuf = value;
+
+			}
+
+		}
+
+		public string ThemeIconName {
+			get { return icon_name; }
+			set {
+				icon_name = value;	
+				preview_image.Pixbuf = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, value, 48, (IconLookupFlags) 0);
+			}
+			
+		}
+
+		
+		void HandleSpinButtonChanged (object sender, EventArgs args)
+		{
+			int value = photo_spin_button.ValueAsInt - 1;
+			
+			image_view.Item.Index = value;
+		}
+
+		void HandleExternalFileSelectionChanged (object sender, EventArgs args)
+		{	//Note: The filter on the FileChooserButton's dialog means that we will have a Pixbuf compatible uri here
+			CreateTagIconFromExternalPhoto ();
+		}
+
+		void CreateTagIconFromExternalPhoto ()
+		{
+			try {
+				using (FSpot.ImageFile img = FSpot.ImageFile.Create(new Uri(external_photo_chooser.Uri))) {
+					using (Gdk.Pixbuf external_image = img.Load ()) {
+						PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (external_image);
+					}
+				}
+			} catch (Exception) {
+				string caption = Catalog.GetString ("Unable to load image");
+				string message = String.Format (Catalog.GetString ("Unable to load \"{0}\" as icon for the tag"), 
+									external_photo_chooser.Uri.ToString ());
+				HigMessageDialog md = new HigMessageDialog (this, 
+									    DialogFlags.DestroyWithParent,
+									    MessageType.Error,
+									    ButtonsType.Close,
+									    caption, 
+									    message);
+				md.Run();
+				md.Destroy();
+			}
+		}
+
+		void HandleSelectionChanged (object sender, EventArgs e)
+		{
+		       	int x = image_view.Selection.X;
+		       	int y = image_view.Selection.Y;
+			int width = image_view.Selection.Width;
+			int height = image_view.Selection.Height;
+		       
+//			if (width > 0 && height > 0) 
+//				icon_view.Selection.Clear ();
+				
+			if (image_view.Pixbuf != null) {
+				if (width > 0 && height > 0) {
+					using (var tmp = new Gdk.Pixbuf (image_view.Pixbuf, x, y, width, height)) {	
+						PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (tmp);
+					}
+				} else {
+					PreviewPixbuf = PixbufUtils.TagIconFromPixbuf (image_view.Pixbuf);
+				}
+			}
+		}
+
+		public void HandlePhotoChanged (object sender, EventArgs e)
+		{
+			int item = image_view.Item.Index;
+			photo_label.Text = String.Format (Catalog.GetString ("Photo {0} of {1}"), 
+							  item + 1, query.Count);
+
+			photo_spin_button.Value = item + 1;
+		}
+
+		public void HandleIconSelectionChanged (object o, EventArgs args)
+		{
+			if (icon_view.SelectedItems.Length == 0)
+				return;
+
+			TreeIter iter;
+			icon_store.GetIter (out iter, icon_view.SelectedItems [0]); 
+			ThemeIconName = (string) icon_store.GetValue (iter, 0);
+		}
+
+		public bool FillIconView ()
+		{
+			icon_store.Clear ();
+			string [] icon_list = FSpot.Global.IconTheme.ListIcons ("Emblems");
+			foreach (string item_name in icon_list)
+				icon_store.AppendValues (item_name, GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, item_name, 32, (IconLookupFlags) 0));
+			return false;
+		}
+	}
+}
diff --git a/src/UI.Dialog/ui/EditTagIconDialog.ui b/src/UI.Dialog/ui/EditTagIconDialog.ui
new file mode 100644
index 0000000..da8ec8d
--- /dev/null
+++ b/src/UI.Dialog/ui/EditTagIconDialog.ui
@@ -0,0 +1,280 @@
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="value">1</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkDialog" id="edit_tag_icon_dialog">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Edit Tag Icon</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox8">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkVBox" id="vbox5">
+            <property name="visible">True</property>
+            <property name="border_width">6</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkFrame" id="frame30">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment34">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkImage" id="preview_image">
+                        <property name="visible">True</property>
+                        <property name="stock">gtk-missing-image</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label95">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Preview&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame31">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment35">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox40">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkScrolledWindow" id="photo_scrolled_window">
+                            <property name="width_request">400</property>
+                            <property name="height_request">300</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">automatic</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" id="hbox5">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkLabel" id="photo_label">
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes">Photo 0 of 0</property>
+                              </object>
+                              <packing>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="photo_spin_button">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="adjustment">adjustment1</property>
+                                <property name="climb_rate">1</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="from_photo_label">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;From Photo&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame14">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment6">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkHBox" id="external_photo_chooser_hbox">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <property name="homogeneous">True</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="from_external_photo_label">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="label" translatable="yes">&lt;b&gt;From External Photo&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame32">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment36">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkScrolledWindow" id="icon_scrolled_window">
+                        <property name="height_request">156</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="predefined_icon_label">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Predefined&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area8">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="noicon_button">
+                <property name="label" translatable="yes">No _image</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="ok_button">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="1">noicon_button</action-widget>
+      <action-widget response="-6">cancel_button</action-widget>
+      <action-widget response="-5">ok_button</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/src/f-spot.glade b/src/f-spot.glade
index bb40b15..2d91648 100644
--- a/src/f-spot.glade
+++ b/src/f-spot.glade
@@ -727,265 +727,6 @@
       </widget>
     </child>
   </widget>
-  <widget class="GtkDialog" id="edit_icon_dialog">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Edit Tag Icon</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox8">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkVBox" id="vbox5">
-            <property name="visible">True</property>
-            <property name="border_width">6</property>
-            <property name="spacing">6</property>
-            <child>
-              <widget class="GtkFrame" id="frame30">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment34">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkImage" id="preview_image">
-                        <property name="visible">True</property>
-                        <property name="stock">gtk-missing-image</property>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label95">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Preview&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkFrame" id="frame31">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment35">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkVBox" id="vbox40">
-                        <property name="visible">True</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkScrolledWindow" id="photo_scrolled_window">
-                            <property name="width_request">400</property>
-                            <property name="height_request">300</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <child>
-                              <placeholder/>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkHBox" id="hbox5">
-                            <property name="visible">True</property>
-                            <child>
-                              <widget class="GtkLabel" id="photo_label">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Photo 0 of 0</property>
-                              </widget>
-                            </child>
-                            <child>
-                              <widget class="GtkSpinButton" id="photo_spin_button">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="adjustment">1 0 100 1 10 0</property>
-                                <property name="climb_rate">1</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </widget>
-                          <packing>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="from_photo_label">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;From Photo&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkFrame" id="frame14">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment6">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkHBox" id="external_photo_chooser_hbox">
-                        <property name="visible">True</property>
-                        <property name="spacing">6</property>
-                        <property name="homogeneous">True</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="from_external_photo_label">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">&lt;b&gt;From External Photo&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkFrame" id="frame32">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment36">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkScrolledWindow" id="icon_scrolled_window">
-                        <property name="height_request">156</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                        <property name="shadow_type">GTK_SHADOW_IN</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="predefined_icon_label">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Predefined&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area8">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="noicon_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label" translatable="yes">No _image</property>
-                <property name="use_underline">True</property>
-                <property name="response_id">1</property>
-              </widget>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <widget class="GtkButton" id="cancel_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-6</property>
-              </widget>
-              <packing>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="ok_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-5</property>
-              </widget>
-              <packing>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
   <widget class="GtkDialog" id="tag_selection_dialog">
     <property name="width_request">300</property>
     <property name="height_request">300</property>
diff --git a/src/main.cs b/src/main.cs
index be9c736..5d0e33f 100644
--- a/src/main.cs
+++ b/src/main.cs
@@ -142,6 +142,9 @@ namespace FSpot
 					// Debug GdkPixbuf critical warnings
 					GLib.LogFunc logFunc = new GLib.LogFunc (GLib.Log.PrintTraceLogFunction);
 					GLib.Log.SetLogHandler ("GdkPixbuf", GLib.LogLevelFlags.Critical, logFunc);
+
+					// Debug Gdk critical warnings
+					GLib.Log.SetLogHandler ("Gdk", GLib.LogLevelFlags.Critical, logFunc);
 			
 					// Debug Gtk critical warnings
 					GLib.Log.SetLogHandler ("Gtk", GLib.LogLevelFlags.Critical, logFunc);



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