diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-06-28 21:35:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-06-28 21:35:52 +0200 |
commit | b86540b743f1a87a163ffb811c8fe22a01fefa38 (patch) | |
tree | b47cb3bb83c2377234226fb3987ab3320a987dd9 /src/faces/FacePage.vala | |
parent | ac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff) | |
parent | e905d8e16eec152d19797937f13ba3cf4b8f8aca (diff) |
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-1
Diffstat (limited to 'src/faces/FacePage.vala')
-rw-r--r-- | src/faces/FacePage.vala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/faces/FacePage.vala b/src/faces/FacePage.vala index f2512d5..1766b91 100644 --- a/src/faces/FacePage.vala +++ b/src/faces/FacePage.vala @@ -44,6 +44,7 @@ public class FacePage : CollectionPage { { "DeleteFace", on_delete_face }, { "RenameFace", on_rename_face }, { "RemoveFaceFromPhotos", on_remove_face_from_photos }, + { "SetFaceRefFromPhoto", on_set_face_ref }, { "DeleteFaceSidebar", on_delete_face }, { "RenameFaceSidebar", on_rename_face } }; @@ -74,6 +75,7 @@ public class FacePage : CollectionPage { menuFaces.add_menu_item(Resources.remove_face_from_photos_menu(this.face.get_name(), get_view().get_count()), "RemoveFaceFromPhotos", "<Primary>r"); menuFaces.add_menu_item(Resources.rename_face_menu(this.face.get_name()), "RenameFace", "<Primary>e"); + menuFaces.add_menu_item(Resources.set_face_from_photo_menu(this.face.get_name()), "SetFaceRefFromPhoto", null); menuFaces.add_menu_item(Resources.delete_face_menu(this.face.get_name()), "DeleteFace", "<Primary>t"); return menuFaces; @@ -102,6 +104,11 @@ public class FacePage : CollectionPage { null, selected_count > 0); + set_action_details("SetFaceRefFromPhoto", + Resources.set_face_from_photo_menu(face.get_name()), + null, + selected_count == 1); + base.update_actions(selected_count, count); } @@ -120,4 +127,11 @@ public class FacePage : CollectionPage { (Gee.Collection<MediaSource>) get_view().get_selected_sources())); } } + + private void on_set_face_ref() { + if (get_view().get_selected_count() == 1) { + get_command_manager().execute(new SetFaceRefCommand(face, + (MediaSource) get_view().get_selected_at(0).get_source())); + } + } } |