public void HandleAlbumAdded(string title)
        {
            GoogleAccount account = (GoogleAccount)accounts [gallery_optionmenu.History];

            PopulateAlbumOptionMenu(account.Picasa);

            // make the newly created album selected
//			PicasaAlbumCollection albums = account.Picasa.GetAlbums();
            for (int i = 0; i < albums.Count; i++)
            {
                if (((PicasaAlbum)albums[i]).Title == title)
                {
                    album_optionmenu.SetHistory((uint)i);
                }
            }
        }
        public void HandleAlbumAdded(string title)
        {
            GalleryAccount account = (GalleryAccount)accounts [gallery_optionmenu.History];

            PopulateAlbumOptionMenu(account.Gallery);

            // make the newly created album selected
            ArrayList albums = account.Gallery.Albums;

            for (int i = 0; i < albums.Count; i++)
            {
                if (((Album)albums[i]).Title == title)
                {
                    album_optionmenu.SetHistory((uint)i);
                }
            }
        }
Beispiel #3
0
        private void PopulateGoogleOptionMenu(GoogleAccountManager manager, GoogleAccount changed_account)
        {
            Gtk.Menu menu = new Gtk.Menu();
            this.account = changed_account;
            int pos = -1;

            accounts = manager.GetAccounts();
            if (accounts == null || accounts.Count == 0)
            {
                Gtk.MenuItem item = new Gtk.MenuItem(Catalog.GetString("(No Gallery)"));
                menu.Append(item);
                gallery_optionmenu.Sensitive = false;
                edit_button.Sensitive        = false;
            }
            else
            {
                int i = 0;
                foreach (GoogleAccount account in accounts)
                {
                    if (account == changed_account)
                    {
                        pos = i;
                    }

                    Gtk.MenuItem item = new Gtk.MenuItem(account.Username);
                    menu.Append(item);
                    i++;
                }
                gallery_optionmenu.Sensitive = true;
                edit_button.Sensitive        = true;
            }

            menu.ShowAll();
            gallery_optionmenu.Menu = menu;
            gallery_optionmenu.SetHistory((uint)pos);
        }