Ejemplo n.º 1
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            var builder = new GtkBeans.Builder (null, "gallery_add_album_dialog.ui", null);
            builder.Autoconnect (this);
            add_album_dialog = new Gtk.Dialog (builder.GetRawObject ("gallery_add_album_dialog"));
            add_album_dialog.Modal = true;

            album_optionmenu = new Gtk.ComboBox ();
            (name_entry.Parent as Gtk.Table).Attach (album_optionmenu, 1, 2, 1, 2);
            album_optionmenu.Show ();

            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);
        }
 public Album(Gallery gallery, string name, int ref_num)
 {
     Name = name;
     this.gallery = gallery;
     this.RefNum = ref_num;
     Images = new ArrayList ();
 }
Ejemplo n.º 3
0
        private void PopulateAlbumOptionMenu(Gallery gallery)
        {
            List<Album> albums = null;
            if (gallery != null)
                //gallery.FetchAlbumsPrune ();
                try {
                    gallery.FetchAlbums ();
                    albums = gallery.Albums;
                } catch (GalleryCommandException e) {
                    gallery.PopupException (e, export_dialog);
                    return;
                }

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

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

                album_optionmenu.AppendText (msg);

                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);

                    album_optionmenu.AppendText (label_builder.ToString ());
                }

                export_button.Sensitive = items.Length > 0;
                album_optionmenu.Sensitive = true;
                album_button.Sensitive = true;
            }
        }
Ejemplo n.º 4
0
 public Album(Gallery gallery, string name, int ref_num)
 {
     Name = name;
     Gallery = gallery;
     this.RefNum = ref_num;
     Images = new List<Image> ();
 }
 public void MarkChanged()
 {
     connected = false;
     gallery = null;
 }
        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"));
            }

            Log.Debug ("Gallery created: " + gal);

            gal.Login (username, password);

            gallery = gal;
            connected = true;

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

            return gallery;
        }