private void GetPreviews() { lock (camera) { ProgressDialog pdialog = new ProgressDialog(Catalog.GetString("Downloading Previews"), ProgressDialog.CancelButtonType.Cancel, camera.FileList.Count, this.Dialog); int index = 0; bool load_thumb = true; System.Collections.ArrayList sfiles = camera.FileList; sfiles.Sort(); foreach (GPhotoCameraFile file in sfiles) { string msg = String.Format(Catalog.GetString("Downloading Preview of {0}"), file.FileName); if (load_thumb && pdialog.Update(msg)) { load_thumb = false; pdialog.Hide(); } Pixbuf scale = null; if (load_thumb) { Pixbuf thumbscale = camera.GetPreviewPixbuf(file); if (thumbscale != null) { scale = PixbufUtils.ScaleToMaxSize(thumbscale, 64, 64); thumbscale.Dispose(); } } preview_list_store.AppendValues(file.Directory, file.FileName, scale, index); index++; } file_tree.Selection.SelectAll(); pdialog.Destroy(); } }