[f-spot: 6/16] Call UpdateQuery() after detach to ensure that the new photo appears on screen
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot: 6/16] Call UpdateQuery() after detach to ensure that the new photo appears on screen
- Date: Tue, 25 May 2010 12:48:41 +0000 (UTC)
commit 2bd63bb848e8c3e7b91fd4dddc6f92cc018bf53f
Author: Anton Keks <anton azib net>
Date: Sun Aug 2 20:27:08 2009 +0300
Call UpdateQuery() after detach to ensure that the new photo appears on screen
src/PhotoVersionCommands.cs | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/PhotoVersionCommands.cs b/src/PhotoVersionCommands.cs
index d4de076..aa7ae3d 100644
--- a/src/PhotoVersionCommands.cs
+++ b/src/PhotoVersionCommands.cs
@@ -198,17 +198,16 @@ public class PhotoVersionCommands
{
string ok_caption = Catalog.GetString ("De_tach");
string msg = String.Format (Catalog.GetString ("Really detach version \"{0}\" from \"{1}\"?"), photo.DefaultVersion.Name, photo.Name.Replace("_", "__"));
- string desc = Catalog.GetString ("This makes the verion appear as a separate photo in the library. To undo, drag the new photo back to its parent.");
+ string desc = Catalog.GetString ("This makes the version appear as a separate photo in the library. To undo, drag the new photo back to its parent.");
try {
if (ResponseType.Ok == HigMessageDialog.RunHigConfirmation(parent_window, DialogFlags.DestroyWithParent,
MessageType.Warning, msg, desc, ok_caption)) {
Gdk.Pixbuf thumbnail = null;
Photo new_photo = store.Create (photo.DefaultVersionUri, photo.RollId, out thumbnail);
new_photo.CopyAttributesFrom (photo.DefaultVersion);
- store.Commit (new_photo);
-
photo.DeleteVersion (photo.DefaultVersionId, false, true);
- store.Commit (photo);
+ store.Commit (new Photo[] {new_photo, photo});
+ MainWindow.Toplevel.UpdateQuery ();
return true;
}
} catch (Exception e) {
@@ -257,7 +256,7 @@ public class PhotoVersionCommands
foreach (uint version_id in version_ids) {
photo.DeleteVersion (version_id, true, true);
}
- App.Instance.Database.Photos.Remove (photo);
+ store.Remove (photo);
}
new_parent.Rating = highest_rating;
new_parent.Description = new_description;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]