private void OnEditButtonClicked(object o, EventArgs args) { // Check right tree first. if (treeview2.Selection.GetSelectedRows().Length > 0) { ArrayList selectedphotos = new ArrayList(); foreach (TreePath path in treeview2.Selection.GetSelectedRows()) { Photo p = new Photo(GetPhoto(path)); // Check if the original version is stored in db. Allow for revert. if (!uploadbutton.Active && !PersistentInformation.GetInstance().HasOriginalPhoto(p.Id) && !PersistentInformation.GetInstance().IsPhotoDirty(p.Id)) { PersistentInformation.GetInstance().InsertOriginalPhoto(p); } TreePath childpath = filter.ConvertPathToChildPath(path); if (GetMode() == DeskFlickrUI.ModeSelected.BlogMode) { string blogid = ((PersistentInformation.Entry) _blogs[leftcurselectedindex]).entry1; BlogEntry blogentry = PersistentInformation.GetInstance().GetEntryForBlog(blogid, p.Id); BlogSelectedPhoto bsel = new BlogSelectedPhoto(p, blogentry, childpath.ToString()); selectedphotos.Add(bsel); } else { SelectedPhoto sel = new SelectedPhoto(p, childpath.ToString()); selectedphotos.Add(sel); } } PhotoEditorUI.FireUp(selectedphotos, GetMode()); } // check left tree now. else if (treeview1.Selection.GetSelectedRows().Length > 0) { if (selectedtab == 1) return; // Tags can't be edited. TreePath path = treeview1.Selection.GetSelectedRows()[0]; Album album = new Album((Album) _albums[path.Indices[0]]); AlbumEditorUI.FireUp(album); } }
private void OnDoubleClickPhoto(object o, RowActivatedArgs args) { ArrayList selectedphotos = new ArrayList(); // Make sure that we don't point to the photo object stored here. // Otherwise, even if the editing is not saved, it would be stored // in _photos. So, create a new Photo object. Photo p = new Photo(GetPhoto(args.Path)); if (!uploadbutton.Active && !PersistentInformation.GetInstance().HasOriginalPhoto(p.Id) && !PersistentInformation.GetInstance().IsPhotoDirty(p.Id)) { PersistentInformation.GetInstance().InsertOriginalPhoto(p); } TreePath childpath = filter.ConvertPathToChildPath(args.Path); if (GetMode() == DeskFlickrUI.ModeSelected.BlogMode) { string blogid = ((PersistentInformation.Entry) _blogs[leftcurselectedindex]).entry1; BlogEntry blogentry = PersistentInformation.GetInstance().GetEntryForBlog(blogid, p.Id); BlogSelectedPhoto bsel = new BlogSelectedPhoto(p, blogentry, childpath.ToString()); selectedphotos.Add(bsel); } else { SelectedPhoto sel = new SelectedPhoto(p, childpath.ToString()); selectedphotos.Add(sel); } PhotoEditorUI.FireUp(selectedphotos, GetMode()); }