private void Upload() { account.Gallery.Progress = new ProgressItem(); account.Gallery.Progress.Changed += HandleProgressChanged; Log.Debug("Starting upload"); FilterSet filters = new FilterSet(); if (account.Version == GalleryVersion.Version1) { filters.Add(new WhiteListFilter(new string [] { ".jpg", ".jpeg", ".png", ".gif" })); } if (scale) { filters.Add(new ResizeFilter((uint)size)); } while (photo_index < items.Length) { IPhoto item = items [photo_index]; Log.DebugFormat("uploading {0}", photo_index); progress_dialog.Message = string.Format(Catalog.GetString("Uploading picture \"{0}\""), item.Name); progress_dialog.Fraction = photo_index / (double)items.Length; photo_index++; progress_dialog.ProgressText = string.Format(Catalog.GetString("{0} of {1}"), photo_index, items.Length); FilterRequest req = new FilterRequest(item.DefaultVersion.Uri); filters.Convert(req); try { int id = album.Add(item, req.Current.LocalPath); if (item != null && item is Photo && App.Instance.Database != null && id != 0) { App.Instance.Database.Exports.Create((item as Photo).Id, (item as Photo).DefaultVersionId, ExportStore.Gallery2ExportType, string.Format("{0}:{1}", album.Gallery.Uri, id.ToString())); } } catch (Exception e) { progress_dialog.Message = string.Format(Catalog.GetString("Error uploading picture \"{0}\" to Gallery: {1}"), item.Name, e.Message); progress_dialog.ProgressText = Catalog.GetString("Error"); Log.Exception(e); if (progress_dialog.PerformRetrySkip()) { photo_index--; } } } progress_dialog.Message = Catalog.GetString("Done Sending Photos"); progress_dialog.Fraction = 1.0; progress_dialog.ProgressText = Catalog.GetString("Upload Complete"); progress_dialog.ButtonLabel = Gtk.Stock.Ok; if (browser) { GtkBeans.Global.ShowUri(export_dialog.Screen, album.GetUrl()); } }