diff -u f-spot-0.6.1.5/debian/changelog f-spot-0.6.1.5/debian/changelog --- f-spot-0.6.1.5/debian/changelog +++ f-spot-0.6.1.5/debian/changelog @@ -1,3 +1,12 @@ +f-spot (0.6.1.5-2ubuntu2) lucid; urgency=low + + * debian/patches/ubuntu_add_editing_to_view_mode.patch + - Enable the "edit" menu in F-Spot's view mode. (LP: #484888) + * debian/patches/ubuntu_fix_disposed_pixbuf_errors_in_adjustment.patch + - Fix disposed pixbuf errors in "Adjust Colours" editor. + + -- Christopher James Halse Rogers Thu, 04 Mar 2010 15:32:19 +1100 + f-spot (0.6.1.5-2ubuntu1) lucid; urgency=low * debian/patches/git_copy_attribute_normal.patch: diff -u f-spot-0.6.1.5/debian/patches/series f-spot-0.6.1.5/debian/patches/series --- f-spot-0.6.1.5/debian/patches/series +++ f-spot-0.6.1.5/debian/patches/series @@ -16,6 +16,8 @@ ubuntu_transition_timing.patch ubuntu_slider_animation_tweaking.patch ubuntu_check_duplicate.patch +ubuntu_add_editing_to_view_mode.patch +ubuntu_fix_disposed_pixbuf_errors_in_adjustment.patch git_copy_attribute_normal.patch git_no_urlencode.patch only in patch2: unchanged: --- f-spot-0.6.1.5.orig/debian/patches/ubuntu_fix_disposed_pixbuf_errors_in_adjustment.patch +++ f-spot-0.6.1.5/debian/patches/ubuntu_fix_disposed_pixbuf_errors_in_adjustment.patch @@ -0,0 +1,35 @@ +Description: Fix disposed pixmap bug in Adjust Colours tool + The code paths in Adjustment.Adjust () for the alpha- and non- alpha channel + cases have an important difference - the alpha channel codepath modifies + Input and returns it, the non-alpha channel path returns a modified copy of + Input. + . + In the alpha case, returning Input eventually results in the preview pixmap + being disposed, causing debug spew and (in View mode) the window to display + garbage. +Author: Christopher Halse Rogers + +=== modified file 'src/ColorAdjustment/Adjustment.cs' +--- a/src/ColorAdjustment/Adjustment.cs 2008-10-06 23:11:41 +0000 ++++ b/src/ColorAdjustment/Adjustment.cs 2010-03-04 04:24:09 +0000 +@@ -64,16 +64,17 @@ + Cms.Profile [] list = GenerateAdjustments ().ToArray (); + + if (Input.HasAlpha) { ++ Gdk.Pixbuf input_copy = (Gdk.Pixbuf)Input.Clone (); + Pixbuf alpha = PixbufUtils.Flatten (Input); + Transform transform = new Transform (list, + PixbufUtils.PixbufCmsFormat (alpha), + PixbufUtils.PixbufCmsFormat (final), + intent, 0x0000); + PixbufUtils.ColorAdjust (alpha, final, transform); +- PixbufUtils.ReplaceColor (final, Input); ++ PixbufUtils.ReplaceColor (final, input_copy); + alpha.Dispose (); + final.Dispose (); +- final = Input; ++ final = input_copy; + } else { + Cms.Transform transform = new Cms.Transform (list, + PixbufUtils.PixbufCmsFormat (Input), + only in patch2: unchanged: --- f-spot-0.6.1.5.orig/debian/patches/ubuntu_add_editing_to_view_mode.patch +++ f-spot-0.6.1.5/debian/patches/ubuntu_add_editing_to_view_mode.patch @@ -0,0 +1,311 @@ +Description: Enable editing in View mode +Author: Christopher Halse Rogers +Author: Ken VanDine +Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/f-spot/+bug/484888 +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=513561 + +=== modified file 'src/Editors/Editor.cs' +--- a/src/Editors/Editor.cs 2009-08-10 17:42:29 +0000 ++++ b/src/Editors/Editor.cs 2010-03-03 07:34:36 +0000 +@@ -18,6 +18,7 @@ + using Mono.Unix; + + using System; ++using System.IO; + + namespace FSpot.Editors { + [ExtensionNode ("Editor")] +@@ -61,6 +62,9 @@ + public event ProcessingStepHandler ProcessingStep; + public event ProcessingFinishedHandler ProcessingFinished; + ++ public PhotoImageView View { get; set; } ++ public Gtk.Window ParentWindow {get; set; } ++ + // Contains the current selection, the items being edited, ... + private EditorState state; + public EditorState State { +@@ -96,7 +100,7 @@ + } + + +- protected void LoadPhoto (Photo photo, out Pixbuf photo_pixbuf, out Cms.Profile photo_profile) { ++ protected void LoadPhoto (IBrowsableItem photo, out Pixbuf photo_pixbuf, out Cms.Profile photo_profile) { + // FIXME: We might get this value from the PhotoImageView. + using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri)) { + photo_pixbuf = img.Load (); +@@ -143,18 +147,29 @@ + } + + int done = 0; +- foreach (Photo photo in State.Items) { ++ foreach (IBrowsableItem item in State.Items) { + Pixbuf input; + Cms.Profile input_profile; +- LoadPhoto (photo, out input, out input_profile); ++ LoadPhoto (item, out input, out input_profile); + + Pixbuf edited = Process (input, input_profile); + input.Dispose (); + +- bool create_version = photo.DefaultVersion.IsProtected; +- photo.SaveVersion (edited, create_version); +- photo.Changes.DataChanged = true; +- Core.Database.Photos.Commit (photo); ++ if (item is Photo) { ++ var photo = item as Photo; ++ bool create_version = photo.DefaultVersion.IsProtected; ++ photo.SaveVersion (edited, create_version); ++ photo.Changes.DataChanged = true; ++ Core.Database.Photos.Commit (photo); ++ } else { ++ var pb = edited.Copy (); ++ using (ImageFile img = ImageFile.Create (item.DefaultVersionUri)) { ++ using (Stream stream = System.IO.File.OpenWrite (item.DefaultVersionUri.LocalPath)) { ++ img.Save (edited, stream); ++ } ++ } ++ State.PhotoImageView.Pixbuf = pb; ++ } + + done++; + if (ProcessingStep != null) { +@@ -205,7 +220,11 @@ + Pixbuf previewed = ProcessFast (preview, null); + State.PhotoImageView.Pixbuf = previewed; + State.PhotoImageView.ZoomFit (false); +- MainWindow.Toplevel.InfoBox.UpdateHistogram (previewed); ++ if (MainWindow.Toplevel != null) { ++ //MainWindow.Toplevel is null if we're in View mode. ++ //If we're in View mode we don't have a histogram, so we don't need to update it. ++ MainWindow.Toplevel.InfoBox.UpdateHistogram (previewed); ++ } + + if (old_preview != null) { + old_preview.Dispose (); +@@ -238,7 +257,11 @@ + State.PhotoImageView.Pixbuf = original; + State.PhotoImageView.ZoomFit (false); + +- MainWindow.Toplevel.InfoBox.UpdateHistogram (null); ++ if (MainWindow.Toplevel != null) { ++ //MainWindow.Toplevel is null if we're in View mode. ++ //If we're in View mode we don't have a histogram, so we dont' need to update it. ++ MainWindow.Toplevel.InfoBox.UpdateHistogram (null); ++ } + } + + Reset (); + +=== modified file 'src/FSpot.addin.xml' +--- a/src/FSpot.addin.xml 2009-11-09 18:12:08 +0000 ++++ b/src/FSpot.addin.xml 2010-03-03 03:14:16 +0000 +@@ -61,8 +61,8 @@ + + + ++ + +- + + + + +=== modified file 'src/MainWindow.cs' +--- a/src/MainWindow.cs 2009-11-05 17:17:47 +0000 ++++ b/src/MainWindow.cs 2010-03-03 23:03:13 +0000 +@@ -341,8 +341,6 @@ + + Sidebar.AppendPage (tag_selection_scrolled, Catalog.GetString ("Tags"), "tag"); + +- AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); +- + Sidebar.Context = ViewContext.Library; + + Sidebar.CloseRequested += HideSidebar; +@@ -453,6 +451,9 @@ + + photo_view.View.ZoomChanged += HandleZoomChanged; + ++ // Sidebar extensions need access to PhotoView, so this has to be delayed until after we've constructed photo_view ++ AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); ++ + // Tag typing: focus the tag entry if the user starts typing a tag + icon_view.KeyPressEvent += HandlePossibleTagTyping; + photo_view.KeyPressEvent += HandlePossibleTagTyping; +@@ -531,8 +532,12 @@ + + private void OnSidebarExtensionChanged (object s, ExtensionNodeEventArgs args) { + // FIXME: No sidebar page removal yet! +- if (args.Change == ExtensionChange.Add) +- Sidebar.AppendPage ((args.ExtensionNode as SidebarPageNode).GetSidebarPage ()); ++ if (args.Change == ExtensionChange.Add) { ++ var page = ((SidebarPageNode)args.ExtensionNode).GetSidebarPage (); ++ page.PhotoImageView = PhotoView.View; ++ page.ParentWindow = Window; ++ Sidebar.AppendPage (page); ++ } + } + + private Photo CurrentPhoto { + +=== modified file 'src/SingleView.cs' +--- a/src/SingleView.cs 2009-09-30 14:45:16 +0000 ++++ b/src/SingleView.cs 2010-03-03 03:14:16 +0000 +@@ -127,9 +127,6 @@ + info_vbox.Add (sidebar); + sidebar.AppendPage (directory_scrolled, Catalog.GetString ("Folder"), "gtk-directory"); + +- AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); +- +- sidebar.Context = ViewContext.Single; + + sidebar.CloseRequested += HandleHideSidePane; + sidebar.Show (); +@@ -149,6 +146,9 @@ + + Window.ShowAll (); + ++ AddinManager.AddExtensionNodeHandler ("/FSpot/Sidebar", OnSidebarExtensionChanged); ++ sidebar.Context = ViewContext.Single; ++ + zoom_scale.ValueChanged += HandleZoomScaleValueChanged; + + LoadPreference (Preferences.VIEWER_SHOW_TOOLBAR); +@@ -189,8 +189,13 @@ + + private void OnSidebarExtensionChanged (object s, ExtensionNodeEventArgs args) { + // FIXME: No sidebar page removal yet! +- if (args.Change == ExtensionChange.Add) +- sidebar.AppendPage ((args.ExtensionNode as SidebarPageNode).GetSidebarPage ()); ++ if (args.Change == ExtensionChange.Add) { ++ var page = (args.ExtensionNode as SidebarPageNode).GetSidebarPage (); ++Log.Debug ("OnSidebarExtensionAdded {0} / {1} / {2}", page, image_view, window); ++ page.PhotoImageView = image_view; ++ page.ParentWindow = window; ++ sidebar.AppendPage (page); ++ } + } + + void HandleExportActivated (object o, EventArgs e) + +=== modified file 'src/Widgets/EditorPage.cs' +--- a/src/Widgets/EditorPage.cs 2009-08-10 17:42:29 +0000 ++++ b/src/Widgets/EditorPage.cs 2010-03-03 23:22:33 +0000 +@@ -23,7 +23,7 @@ + namespace FSpot.Widgets { + public class EditorPage : SidebarPage { + internal bool InPhotoView; +- private readonly EditorPageWidget EditorPageWidget; ++ readonly EditorPageWidget EditorPageWidget; + + public EditorPage () : base (new EditorPageWidget (), + Catalog.GetString ("Edit"), +@@ -34,6 +34,16 @@ + EditorPageWidget.Page = this; + } + ++ public override PhotoImageView PhotoImageView { ++ get { return EditorPageWidget.PhotoImageView; } ++ set { EditorPageWidget.PhotoImageView = value; } ++ } ++ ++ public override Gtk.Window ParentWindow { ++ get { return EditorPageWidget.ParentWindow; } ++ set { EditorPageWidget.ParentWindow = value ;} ++ } ++ + protected override void AddedToSidebar () { + Sidebar.SelectionChanged += delegate (IBrowsableCollection collection) { EditorPageWidget.ShowTools (); }; + Sidebar.ContextChanged += HandleContextChanged; +@@ -41,18 +51,22 @@ + + private void HandleContextChanged (object sender, EventArgs args) + { +- InPhotoView = (Sidebar.Context == ViewContext.Edit); ++Log.Debug ("ContextChanged {0}", Sidebar.Context); ++ InPhotoView = (Sidebar.Context == ViewContext.Edit) || (Sidebar.Context == ViewContext.Single); + EditorPageWidget.ChangeButtonVisibility (); + } + } + + public class EditorPageWidget : ScrolledWindow { +- private VBox widgets; +- private VButtonBox buttons; +- private Widget active_editor; +- +- private List editors; +- private Editor current_editor; ++ VBox widgets; ++ VButtonBox buttons; ++ Widget active_editor; ++ ++ List editors; ++ Editor current_editor; ++ ++ public PhotoImageView PhotoImageView { get; set;} ++ public Gtk.Window ParentWindow { get; set; } + + // Used to make buttons insensitive when selecting multiple images. + private Dictionary editor_buttons; +@@ -78,6 +92,8 @@ + editor.ProcessingStarted += OnProcessingStarted; + editor.ProcessingStep += OnProcessingStep; + editor.ProcessingFinished += OnProcessingFinished; ++ editor.View = PhotoImageView; ++ editor.ParentWindow = ParentWindow; + editors.Add (editor); + PackButton (editor); + } +@@ -86,7 +102,7 @@ + private ProgressDialog progress; + + private void OnProcessingStarted (string name, int count) { +- progress = new ProgressDialog (name, ProgressDialog.CancelButtonType.None, count, MainWindow.Toplevel.Window); ++ progress = new ProgressDialog (name, ProgressDialog.CancelButtonType.None, count, ParentWindow); + } + + private void OnProcessingStep (int done) { +@@ -171,8 +187,7 @@ + private bool SetupEditor (Editor editor) { + EditorState state = editor.CreateState (); + +- PhotoImageView photo_view = MainWindow.Toplevel.PhotoView.View; +- ++ PhotoImageView photo_view = PhotoImageView; + if (Page.InPhotoView && photo_view != null) { + state.Selection = photo_view.Selection; + state.PhotoImageView = photo_view; +@@ -196,7 +211,7 @@ + string msg = Catalog.GetString ("No selection available"); + string desc = Catalog.GetString ("This tool requires an active selection. Please select a region of the photo and try the operation again"); + +- HigMessageDialog md = new HigMessageDialog (MainWindow.Toplevel.Window, ++ HigMessageDialog md = new HigMessageDialog (ParentWindow, + DialogFlags.DestroyWithParent, + Gtk.MessageType.Error, ButtonsType.Ok, + msg, +@@ -217,7 +232,7 @@ + string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Note that you have to develop RAW files into JPEG before you can edit them."), + e.Message); + +- HigMessageDialog md = new HigMessageDialog (MainWindow.Toplevel.Window, ++ HigMessageDialog md = new HigMessageDialog (ParentWindow, + DialogFlags.DestroyWithParent, + Gtk.MessageType.Error, ButtonsType.Ok, + msg, + +=== modified file 'src/Widgets/Sidebar.cs' +--- a/src/Widgets/Sidebar.cs 2009-08-10 17:42:29 +0000 ++++ b/src/Widgets/Sidebar.cs 2010-03-03 03:14:16 +0000 +@@ -110,6 +110,9 @@ + // Can be overriden to get notified as soon as we're added to a sidebar. + protected virtual void AddedToSidebar () { } + ++ public virtual PhotoImageView PhotoImageView { get; set; } ++ public virtual Gtk.Window ParentWindow { get; set; } ++ + // Whether this page is currently visible + public bool IsActive { + get { return Sidebar.IsActive (this); } +