示例#1
0
        internal FSpotUploadProgress(
				Picture [] pictures,
				ThreadProgressDialog progress_dialog)
            : base(pictures)
        {
            this.progress_dialog = progress_dialog;
        }
        public TotalUploadProgress(Picture [] pictures)
        {
            Debug.Assert (null != pictures, "No pictures!");

            total_file_count = pictures.Length;
            total_file_size = GetTotalFileSize (pictures);
        }
		public TotalUploadProgress (Picture [] pictures)
		{
			if (null == pictures) Log.DebugFormat ("No pictures!");

			total_file_count = pictures.Length;
			total_file_size = GetTotalFileSize (pictures);
		}
示例#4
0
        private Picture[] GetPicturesForUpload()
        {
            Picture [] pictures = new Picture [model.Photos.Length];
            FSpot.IBrowsableItem [] items = model.Photos;

            for (int i = 0; i < pictures.Length; ++i) {
                string mime_type = GLib.FileFactory.NewForUri (items [i].DefaultVersionUri).
                            QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;

                pictures [i] = new Picture (items [i].Name,
                        items [i].DefaultVersionUri,
                        mime_type,
                        model.Privacy);
            }

            return pictures;
        }
示例#5
0
        private void OnUploadStarted(Picture [] pictures)
        {
            Debug.Assert (null != pictures);
            Debug.Assert (null != uploader);
            Debug.Assert (null != progress_dialog);

            // Initialize the debug output listener.
            // `Mono.Tabblo' uses the standard
            // `System.Diagnostics.Debug' facilities for debug
            // output only.
            debug_listener = new FSpotTraceListener ();
            Debug.Listeners.Add (debug_listener);

            // Initialize the progress handler.
            upload_progress = new FSpotUploadProgress (
                    pictures, progress_dialog);
            uploader.ProgressChanged +=
                    upload_progress.HandleProgress;

            // Set up the certificate policy.
            ServicePointManager.CertificatePolicy =
                    new UserDecisionCertificatePolicy ();
        }
		private Picture [] GetPicturesForUpload ()
		{
			if (null == photos) Log.DebugFormat ("No photos");
			if (null == preferences) Log.DebugFormat ("No preferences");

			Picture [] pictures = new Picture [photos.Items.Length];

			for (int i = 0; i < pictures.Length; ++i) {
				FSpot.IBrowsableItem photo = photos.Items [i];

				// FIXME: GnomeVFS is deprecated, we should use
				// GIO instead.  However, I don't know how to
				// call `GLib.Content.TypeGuess ()'.
				string path = photo.DefaultVersionUri.LocalPath;
				string mime_type = Gnome.Vfs.MimeType
						.GetMimeTypeForUri (path);

				pictures [i] = new Picture (photo.Name,
						photo.DefaultVersionUri,
						mime_type,
						preferences.Privacy);
			}

			return pictures;
		}
        private static ulong GetTotalFileSize(Picture [] pictures)
        {
            Debug.Assert (null != pictures, "No pictures!");

            ulong size = 0;

            foreach (Picture picture in pictures) {
                FileInfo info = new FileInfo (
                        picture.Uri.LocalPath);
                size += (ulong) info.Length;
            }

            return size;
        }
		private static ulong GetTotalFileSize (Picture [] pictures)
		{
			if (null == pictures) Log.DebugFormat ("No pictures!");

			ulong size = 0;

			foreach (Picture picture in pictures) {
				FileInfo info = new FileInfo (
						picture.Uri.LocalPath);
				size += (ulong) info.Length;
			}

			return size;
		}