summaryrefslogtreecommitdiff
path: root/src/faces/FacePage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:37 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:37 +0200
commitbb80d3feebdc9acc52e3f4ad24084d8425f043a2 (patch)
tree2084a84c39f159c6aea254775dc0880d52579d45 /src/faces/FacePage.vala
parentb26ff0798252a1a8072dd2c7a67f6205de9fde11 (diff)
parent31804433d72460cbe0a39f9f8ea5e76058d84cda (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/faces/FacePage.vala')
-rw-r--r--src/faces/FacePage.vala14
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()));
+ }
+ }
}