public Album (Gallery gallery, string name, int ref_num)
		{
			Name = name;
			this.gallery = gallery;
			this.RefNum = ref_num;
			Images = new ArrayList ();
		}
示例#2
0
        private void PopulateAlbumOptionMenu(Gallery gallery)
        {
            System.Collections.ArrayList albums = null;
            if (gallery != null) {
                //gallery.FetchAlbumsPrune ();
                try {
                    gallery.FetchAlbums ();
                    albums = gallery.Albums;
                } catch (GalleryCommandException e) {
                    gallery.PopupException (e, export_dialog);
                    return;
                }
            }

            Gtk.Menu menu = new Gtk.Menu ();

            bool disconnected = gallery == null || !account.Connected || albums == null;

            if (disconnected || albums.Count == 0) {
                string msg = disconnected ? Catalog.GetString ("(Not Connected)")
                    : Catalog.GetString ("(No Albums)");

                Gtk.MenuItem item = new Gtk.MenuItem (msg);
                menu.Append (item);

                export_button.Sensitive = false;
                album_optionmenu.Sensitive = false;
                album_button.Sensitive = false;

                if (disconnected)
                    album_button.Sensitive = false;
            } else {
                foreach (Album album in albums) {
                    System.Text.StringBuilder label_builder = new System.Text.StringBuilder ();

                    for (int i=0; i < album.Parents.Count; i++) {
                        label_builder.Append ("  ");
                    }
                    label_builder.Append (album.Title);

                    Gtk.MenuItem item = new Gtk.MenuItem (label_builder.ToString ());
                    ((Gtk.Label)item.Child).UseUnderline = false;
                    menu.Append (item);

                        AlbumPermission add_permission = album.Perms & AlbumPermission.Add;

                    if (add_permission == 0)
                        item.Sensitive = false;
                }

                export_button.Sensitive = items.Length > 0;
                album_optionmenu.Sensitive = true;
                album_button.Sensitive = true;
            }

            menu.ShowAll ();
            album_optionmenu.Menu = menu;
        }
示例#3
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
            xml.Autoconnect (this);
            add_album_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_album_dialog");
            add_album_dialog.Modal = true;
            this.export = export;
            this.gallery = gallery;
            PopulateAlbums ();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
示例#4
0
 public void MarkChanged()
 {
     connected = false;
     gallery = null;
 }
示例#5
0
        public Gallery Connect()
        {
            //System.Console.WriteLine ("GalleryAccount.Connect()");
            Gallery gal = null;

            if (version == GalleryVersion.VersionUnknown)
                this.version = Gallery.DetectGalleryVersion(Url);

            if (version == GalleryVersion.Version1) {
                gal = new Gallery1 (url, url);
            } else if (version == GalleryVersion.Version2) {
                gal = new Gallery2 (url, url);
            } else {
                throw new GalleryException (Catalog.GetString("Cannot connect to a Gallery for which the version is unknown.\nPlease check that you have Remote plugin 1.0.8 or later"));
            }

            System.Console.WriteLine ("Gallery created: " + gal);

            gal.Login (username, password);

            gallery = gal;
            connected = true;

            gallery.expect_continue = Preferences.Get<bool> (LIGHTTPD_WORKAROUND_KEY);

            return gallery;
        }
		public GalleryAddAlbum (GalleryExport export, Gallery gallery) : base ("gallery_add_album_dialog")
		{
			this.export = export;
			this.gallery = gallery;	
			PopulateAlbums ();
			
			Dialog.Response += HandleAddResponse;

			name_entry.Changed += HandleChanged;
			description_entry.Changed += HandleChanged;
			title_entry.Changed += HandleChanged;
			HandleChanged (null, null);
		}