예제 #1
0
            private void HandleFaceButtonClicked(object sender, EventArgs args)
            {
                if (m_list.Count > 0)
                {
                    return;                                // we already did detection for that image
                }
                Face[]    face_list;
                GLib.List g_list;
                Photo     photo = (Photo)View.Item.Current;

                face_list = face_store.GetFacesByPhotoId(photo.Id);

                foreach (Face f in face_list)
                {
                    m_list.Add(f);
                }

                if (face_list.Length == 0)
                {
                    g_list = View.BoxFrame();
                    System.Collections.IEnumerator rect_num = g_list.GetEnumerator();

                    for (int i = 1; i < g_list.Count; i++)
                    {
                        rect_num.MoveNext();
                        m_list.Add(new Face((Gdk.Rectangle)rect_num.Current));
                    }
                }

                m_spin.SetRange(1, m_list.Count);
                m_face = (Face)m_list[0];
                if (m_face.TagId > 0)
                {
                    tag_entry.Text = m_face.Tag.Name;
                }
                else
                {
                    tag_entry.Text = "";
                }
                m_spin.Spin(SpinType.End, 0.0);                 // do this so the event gets fired and proper m_rect selected

                m_newtag_button.Sensitive = true;
                m_spin.Sensitive          = true;
                tag_entry.Sensitive       = true;
            }