Inheritance: Gtk.IconView
Exemplo n.º 1
0
        private void ShowPhotoFaces()
        {
            try
            {
                ClearPhotoFaces();
                if( SelectedItem == null)return;
                //FSpot.Photo photo = (FSpot.Photo) SelectedItem;
                if(vboxRemoved){
                    //AddWithViewport (mainVBox);
                    //mainVBox.Visible = true;
                    pleaseSelectPictureLabel.Markup = "Image Selected";
                    knownFaceScrolledWindow.Visible = true;
                    unknownFaceScrolledWindow.Visible = true;
                    vboxRemoved = false;
                }

                //IBrowsableItem[] knownFaceItems = FaceSpotDb.Instance.Faces.GetKnownFaceByPhoto(photo);

                //knownFaceList = new PhotoList(knownFaceItems);
                knownFaceIconView = new FaceIconView(FaceIconView.Type.KnownFaceSidebar);
                knownFaceScrolledWindow.AddWithViewport(knownFaceIconView);
                knownFaceExpander.Expanded = true;
                knownFaceIconView.SelectionChanged += KnownFaceIconViewSelectionChanged;

                //IBrowsableItem[] unknownFaceItems = FaceSpotDb.Instance.Faces.GetNotKnownFaceByPhoto(photo);

                //unknownFaceList = new PhotoList(unknownFaceItems);
                unknownFaceIconView = new FaceIconView(FaceIconView.Type.UnknownFaceSidebar);
                unknownFaceScrolledWindow.AddWithViewport(unknownFaceIconView);
                unknownFaceExpander.Expanded = true;
                unknownFaceIconView.SelectionChanged += UnknownFaceIconViewSelectionChanged;
                ShowAll();

            //				FaceOverlay.Instance.ShowOverlayFaces();
            }
            catch (Exception e){
                FSpot.Utils.Log.Exception (e);
            }
        }
Exemplo n.º 2
0
        public void Run(object o, EventArgs e)
        {
            Log.Debug ("Executing FaceSpotBrowser");
            initGladeXML();
            browserWindow = (Gtk.Window) xml.GetWidget(dialog_name);
            browserWindow.Title = "F-Spot : FaceSpot FaceBrowser";
            //builder = new GtkBeans.Builder("FaceSpot.ui.FaceSpot.ui");
            //builder.Autoconnect(this)
            //menuitem_preference.Activated += Menuitem_preferenceActivated;

            //			yesImage = new Image("Yes",IconSize.Button);
            //			noImage = new Image("No",IconSize.Button);
            //			SuggestionConfirmButton.Image = yesImage;
            //			SuggestionDeclineButton.Image = noImage;
            //			SuggestionConfirmButton.ImagePosition = PositionType.Left;

            SuggestionConfirmButton.Sensitive = false;
            //SuggestionConfirmButton.Label = "Yes";
            SuggestionConfirmButton.Clicked += SuggestionConfirmButtonClicked;

            SuggestionDeclineButton.Sensitive = false;
            //SuggestionDeclineButton.Label = "No";
            SuggestionDeclineButton.Clicked += SuggestionDeclineButtonClicked;

            peopleTreeView = new PeopleTreeView();
            KnownFaceScrolledWindow.Add(peopleTreeView);
            peopleTreeView.Selection.Changed += PeopleTreeViewSelectionChanged;

            knownFaceIconView = new FaceIconView(FaceIconView.Type.KnownFaceBrowser,null);
            KnownFacePhotoScrolledWindow.Add(knownFaceIconView);
            knownFaceIconView.SelectionChanged += KnownFaceIconViewSelectionChanged;

            suggestFaceIconView = new FaceIconView(FaceIconView.Type.SuggestedFaceBrowser,null);
            SuggestedFacePhotoScrolledWindow.Add(suggestFaceIconView);
            suggestFaceIconView.SelectionChanged += SuggestFaceIconViewSelectionChanged;

            unknownFaceIconView = new FaceIconView(FaceIconView.Type.UnknownFaceBrowser,null);
            UnknownFaceScrolledWindow.Add(unknownFaceIconView);
            //			FaceSpotDb.Instance.Faces.ItemsAdded += FaceSpotDbInstanceFacesItemsAdded;
            //			FaceSpotDb.Instance.Faces.ItemsChanged += FaceSpotDbInstanceFacesItemsChanged;
            //			FaceSpotDb.Instance.Faces.ItemsRemoved += FaceSpotDbInstanceFacesItemsRemoved;

            UnknownFaceButton.Clicked += UnknownFaceButtonClicked;

            ToggleImageFaceButton.Toggled += ToggleImageFaceButtonToggled;
            browserWindow.ShowAll();
        }
Exemplo n.º 3
0
        public void Activate(Gdk.EventButton eb, 
		                     //Face face, Face[] faces,
		                     FaceIconView iconView)
        {
            //this.face = face; this.faces= faces;
            this.iconView = iconView;
            if(iconView.type == FaceIconView.Type.SuggestedFaceBrowser
               || IsAllSelectionSuggested()
               ){
                GtkUtil.MakeMenuItem(this,"Confirm Person",new EventHandler(ConfirmActivated),SelectedFaces.Length>0);
                GtkUtil.MakeMenuItem(this,"Decline Person",new EventHandler(DeclineActivated),SelectedFaces.Length>0);
                GtkUtil.MakeMenuSeparator(this);
            }

            //			if(SelectedFaces.Length == 1 && iconView.IsBrowserType)
            //			{
            //				GtkUtil.MakeMenuItem(this,"Show In Main Window",new EventHandler(ShowImageActivated),SelectedFaces.Length>0);
            //				GtkUtil.MakeMenuSeparator(this);
            //			}

            if(SelectedFaces.Length == 1 && iconView.IsSideBarType)
                GtkUtil.MakeMenuItem(this,"Move Face",new EventHandler(MoveActivated),true);

            if(SelectedFaces.Length == 1)
                GtkUtil.MakeMenuItem(this,"Change Person",new EventHandler(EditActivated),true);

            MenuItem ChangePersonTo = GtkUtil.MakeMenuItem(this, "Change Person to",null,true);

            if(ChangePersonTo != null){
                PopulatePeopleCategories (ChangePersonTo,People.Tag);
                if  ( ChangePersonTo.Submenu != null )
                    GtkUtil.MakeMenuSeparator((Menu)ChangePersonTo.Submenu);
                else
                    ChangePersonTo.Submenu = new Menu();
                GtkUtil.MakeMenuItem((Menu)ChangePersonTo.Submenu,"-", new EventHandler(ChangePersonToNoOneActivated));
            }

            GtkUtil.MakeMenuItem(this,
                                 Catalog.GetPluralString("Delete Face","Delete Faces",SelectedFaces.Length),
                                 new EventHandler(DeleteActivated),true);
            //Add Confirm Popup Menu
            this.Popup(null,null,null,eb.Button,Gtk.Global.CurrentEventTime);
        }