private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                if (command_thread != null && command_thread.IsAlive)
                {
                    command_thread.Abort();
                }

                Dialog.Destroy();
                return;
            }

            if (fr.CheckLogin() == null)
            {
                do_export_flickr.Sensitive = false;
                HigMessageDialog md =
                    new HigMessageDialog(Dialog,
                                         Gtk.DialogFlags.Modal |
                                         Gtk.DialogFlags.DestroyWithParent,
                                         Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
                                         Catalog.GetString("Unable to log on."),
                                         string.Format(Catalog.GetString("F-Spot was unable to log on to {0}.  Make sure you have given the authentication using {0} web browser interface."),
                                                       current_service.Name));
                md.Run();
                md.Destroy();
                return;
            }

            fr.ExportTags = tag_check.Active;
            open          = open_check.Active;
            scale         = scale_check.Active;
            copy_metadata = !meta_check.Active;
            is_public     = public_radio.Active;
            is_family     = family_check.Active;
            is_friend     = friend_check.Active;
            if (scale)
            {
                size = size_spin.ValueAsInt;
            }

            command_thread      = new Thread(new ThreadStart(Upload));
            command_thread.Name = Catalog.GetString("Uploading Pictures");

            Dialog.Destroy();
            progress_dialog = new FSpot.ThreadProgressDialog(command_thread, selection.Count);
            progress_dialog.Start();

            // Save these settings for next time
            Preferences.Set(Preferences.EXPORT_FLICKR_SCALE, scale);
            Preferences.Set(Preferences.EXPORT_FLICKR_SIZE, size);
            Preferences.Set(Preferences.EXPORT_FLICKR_BROWSER, open);
            Preferences.Set(Preferences.EXPORT_FLICKR_TAGS, tag_check.Active);
            Preferences.Set(Preferences.EXPORT_FLICKR_STRIP_META, meta_check.Active);
            Preferences.Set(Preferences.EXPORT_FLICKR_PUBLIC, public_radio.Active);
            Preferences.Set(Preferences.EXPORT_FLICKR_FAMILY, family_check.Active);
            Preferences.Set(Preferences.EXPORT_FLICKR_FRIENDS, friend_check.Active);
            Preferences.Set(current_service.PreferencePath, fr.Token);
        }
Ejemplo n.º 2
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                Dialog.Destroy();
                return;
            }

            if (scale_check != null)
            {
                scale = scale_check.Active;
                size  = size_spin.ValueAsInt;
            }
            else
            {
                scale = false;
            }

            browser = browser_check.Active;
            rotate  = rotate_check.Active;
//			meta = meta_check.Active;
            export_tag = tag_check.Active;

            if (account != null)
            {
                //System.Console.WriteLine ("history = {0}", album_optionmenu.History);
                album       = (PicasaAlbum)account.Picasa.GetAlbums() [Math.Max(0, album_optionmenu.History)];
                photo_index = 0;

                Dialog.Destroy();

                command_thread      = new System.Threading.Thread(new System.Threading.ThreadStart(this.Upload));
                command_thread.Name = Catalog.GetString("Uploading Pictures");

                progress_dialog = new FSpot.ThreadProgressDialog(command_thread, items.Length);
                progress_dialog.Start();

                // Save these settings for next time
                Preferences.Set(SCALE_KEY, scale);
                Preferences.Set(SIZE_KEY, size);
                Preferences.Set(ROTATE_KEY, rotate);
                Preferences.Set(BROWSER_KEY, browser);
//				Preferences.Set (Preferences.EXPORT_GALLERY_META, meta);
                Preferences.Set(TAG_KEY, export_tag);
            }
        }
Ejemplo n.º 3
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                Dialog.Destroy();
                return;
            }

            if (account != null)
            {
                Dialog.Hide();

                command_thread      = new System.Threading.Thread(new System.Threading.ThreadStart(Upload));
                command_thread.Name = Mono.Unix.Catalog.GetString("Uploading Pictures");

                progress_dialog = new FSpot.ThreadProgressDialog(command_thread, items.Length);
                progress_dialog.Start();
            }
        }
Ejemplo n.º 4
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
#if GIO_2_16
            if (listwindow != null)
            {
                listwindow.Destroy();
            }
#endif
            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                Dialog.Destroy();
                return;
            }

            clean  = remove_check.Active;
            rotate = rotate_check.Active;
            Dialog.Destroy();

            command_thread      = new System.Threading.Thread(new System.Threading.ThreadStart(Transfer));
            command_thread.Name = Catalog.GetString("Transferring Pictures");

            progress_dialog = new FSpot.ThreadProgressDialog(command_thread, selection.Count);
            progress_dialog.Start();
        }
		private void HandleResponse (object sender, Gtk.ResponseArgs args)
		{
			if (args.ResponseId != Gtk.ResponseType.Ok) {
				Dialog.Destroy ();
				return;
			}

			if (scale_check != null) {
				scale = scale_check.Active;
				size = size_spin.ValueAsInt;
			} else
				scale = false;

			browser = browser_check.Active;
			rotate = rotate_check.Active;
//			meta = meta_check.Active;
			export_tag = tag_check.Active;

			if (account != null) {
				//System.Console.WriteLine ("history = {0}", album_optionmenu.History);
				album = (PicasaAlbum) account.Picasa.GetAlbums() [Math.Max (0, album_optionmenu.History)];
				photo_index = 0;

				Dialog.Destroy ();

				command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (this.Upload));
				command_thread.Name = Catalog.GetString ("Uploading Pictures");

				progress_dialog = new FSpot.ThreadProgressDialog (command_thread, items.Length);
				progress_dialog.Start ();

				// Save these settings for next time
				Preferences.Set (SCALE_KEY, scale);
				Preferences.Set (SIZE_KEY, size);
				Preferences.Set (ROTATE_KEY, rotate);
				Preferences.Set (BROWSER_KEY, browser);
//				Preferences.Set (Preferences.EXPORT_GALLERY_META, meta);
				Preferences.Set (TAG_KEY, export_tag);
			}
		}
Ejemplo n.º 6
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            int  size          = 0;
            bool UserCancelled = false;
            bool rotate        = true;

            // Lets remove the mail "create mail" dialog
            Dialog.Destroy();

            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                return;
            }
            ProgressDialog progress_dialog = null;

            progress_dialog = new ProgressDialog(Catalog.GetString("Preparing email"),
                                                 ProgressDialog.CancelButtonType.Stop,
                                                 selection.Count,
                                                 parent_window);

            size = GetScaleSize();             // Which size should we scale to. 0 --> Original

            // evaluate mailto command and define attachment args for cli
            System.Text.StringBuilder attach_arg = new System.Text.StringBuilder();
            switch (Preferences.Get <string> (Preferences.GNOME_MAILTO_COMMAND))
            {
            case "thunderbird %s":
            case "mozilla-thunderbird %s":
            case "seamonkey -mail -compose %s":
            case "icedove %s":
                attach_arg.Append(",");
                break;

            case "kmail %s":
                attach_arg.Append(" --attach ");
                break;

            default:                      //evolution falls into default, since it supports mailto uri correctly
                attach_arg.Append("&attach=");
                break;
            }

            rotate = rotate_check.Active;              // Should we automatically rotate original photos.
            Preferences.Set(Preferences.EXPORT_EMAIL_ROTATE, rotate);

            // Initiate storage for temporary files to be deleted later
            tmp_paths = new System.Collections.ArrayList();

            // Create a tmp directory.
            tmp_mail_dir = System.IO.Path.GetTempFileName();                    // Create a tmp file
            System.IO.File.Delete(tmp_mail_dir);                                // Delete above tmp file
            System.IO.Directory.CreateDirectory(tmp_mail_dir);                  // Create a directory with above tmp name

            System.Text.StringBuilder mail_attach = new System.Text.StringBuilder();

            FilterSet filters = new FilterSet();

            if (size != 0)
            {
                filters.Add(new ResizeFilter((uint)size));
            }
            else if (rotate)
            {
                filters.Add(new OrientationFilter());
            }
            filters.Add(new UniqueNameFilter(tmp_mail_dir));


            for (int i = 0; i < selection.Count; i++)
            {
                Photo photo = selection [i] as Photo;
                if ((photo != null) && (!UserCancelled))
                {
                    if (progress_dialog != null)
                    {
                        UserCancelled = progress_dialog.Update(String.Format
                                                                   (Catalog.GetString("Exporting picture \"{0}\""), photo.Name));
                    }

                    if (UserCancelled)
                    {
                        break;
                    }

                    try {
                        // Prepare a tmp_mail file name
                        FilterRequest request = new FilterRequest(photo.DefaultVersionUri);

                        filters.Convert(request);
                        request.Preserve(request.Current);

                        mail_attach.Append(attach_arg.ToString() + request.Current.ToString());

                        // Mark the path for deletion
                        tmp_paths.Add(request.Current.LocalPath);
                    } catch (Exception e) {
                        Console.WriteLine("Error preparing {0}: {1}", selection[photo_index].Name, e.Message);
                        HigMessageDialog md = new HigMessageDialog(parent_window,
                                                                   DialogFlags.DestroyWithParent,
                                                                   MessageType.Error,
                                                                   ButtonsType.Close,
                                                                   Catalog.GetString("Error processing image"),
                                                                   String.Format(Catalog.GetString("An error occured while processing \"{0}\": {1}"), selection[photo_index].Name, e.Message));
                        md.Run();
                        md.Destroy();
                        UserCancelled = true;
                    }
                }
            }             // foreach

            if (progress_dialog != null)
            {
                progress_dialog.Destroy();                  // No need to keep this window
            }
            if (UserCancelled)
            {
                DeleteTempFile();
            }
            else
            {
                // Send the mail :)
                string mail_subject = Catalog.GetString("my photos");
                switch (Preferences.Get <string> (Preferences.GNOME_MAILTO_COMMAND))
                {
                // openSuSE
                case "thunderbird %s":
                    System.Diagnostics.Process.Start("thunderbird", " -compose \"subject=" + mail_subject + ",attachment='" + mail_attach + "'\"");
                    break;

                case "icedove %s":
                    System.Diagnostics.Process.Start("icedove", " -compose \"subject=" + mail_subject + ",attachment='" + mail_attach + "'\"");
                    break;

                case "mozilla-thunderbird %s":
                    System.Diagnostics.Process.Start("mozilla-thunderbird", " -compose \"subject=" + mail_subject + ",attachment='" + mail_attach + "'\"");
                    break;

                case "seamonkey -mail -compose %s":
                    System.Diagnostics.Process.Start("seamonkey", " -mail -compose \"subject=" + mail_subject + ",attachment='" + mail_attach + "'\"");
                    break;

                case "kmail %s":
                    System.Diagnostics.Process.Start("kmail", "  --composer --subject \"" + mail_subject + "\"" + mail_attach);
                    break;

                default:
                    GnomeUtil.UrlShow("mailto:?subject=" + System.Web.HttpUtility.UrlEncode(mail_subject) + mail_attach);
                    break;
                }

                // Check if we have any temporary files to be deleted
                if (tmp_paths.Count > 0)
                {
                    // Fetch timeout value from preferences. In seconds. Needs to be multiplied with 1000 to get msec
                    uint delete_timeout;
                    delete_timeout = (uint)(Preferences.Get <int> (Preferences.EXPORT_EMAIL_DELETE_TIMEOUT_SEC));
                    delete_timeout = delete_timeout * 1000;                     // to get milliseconds.

                    // Start a timer and when it occurs, delete the temp files.
                    GLib.Timeout.Add(delete_timeout, new GLib.TimeoutHandler(DeleteTempFile));
                }
            }
        }
Ejemplo n.º 7
0
		private void HandleResponse (object sender, Gtk.ResponseArgs args)
		{
			long new_size = 0;
//			long orig_size = 0;
			long actual_total_size = 0;
			int size = 0;
			System.IO.FileInfo file_info;
			bool UserCancelled = false;
			bool rotate = true;

			// Lets remove the mail "create mail" dialog
			Dialog.Destroy();			

			if (args.ResponseId != Gtk.ResponseType.Ok) {
				return;
			}
			ProgressDialog progress_dialog = null;
			actual_total_size = 0;
		
			progress_dialog = new ProgressDialog (Catalog.GetString ("Preparing email"),
							      ProgressDialog.CancelButtonType.Stop,
							      selection.Items.Length, 
							      parent_window);
			
			size = GetScaleSize(); // Which size should we scale to. 0 --> Original
			
			// evaluate mailto command and define attachment args for cli
			System.Text.StringBuilder attach_arg = new System.Text.StringBuilder ();
			switch (Preferences.Get (Preferences.GNOME_MAILTO_COMMAND) as string) {
				case "thunderbird %s":
				case "mozilla-thunderbird %s":
				case "seamonkey -mail -compose %s":
				case "icedove %s":
					attach_arg.Append(",");
				break;
				case "kmail %s":
					attach_arg.Append(" --attach ");
				break;
				default:  //evolution falls into default, since it supports mailto uri correctly
					attach_arg.Append("&attach=");
				break;
			}

			rotate = rotate_check.Active;  // Should we automatically rotate original photos.
			Preferences.Set (Preferences.EXPORT_EMAIL_ROTATE, rotate);

			// Initiate storage for temporary files to be deleted later
			tmp_paths = new System.Collections.ArrayList();
			
			// Create a tmp directory.
			tmp_mail_dir = System.IO.Path.GetTempFileName ();	// Create a tmp file	
			System.IO.File.Delete (tmp_mail_dir);			// Delete above tmp file
			System.IO.Directory.CreateDirectory (tmp_mail_dir);	// Create a directory with above tmp name
			
			System.Text.StringBuilder mail_attach = new System.Text.StringBuilder ();

			FilterSet filters = new FilterSet ();

			if (size != 0)
				filters.Add (new ResizeFilter ((uint) size));
			else if (rotate)
				filters.Add (new OrientationFilter ());
			filters.Add (new UniqueNameFilter (tmp_mail_dir));


			foreach (Photo photo in selection.Items) {
			
				if ( (photo != null) && (!UserCancelled) ) {

					if (progress_dialog != null)
						UserCancelled = progress_dialog.Update (String.Format 
							(Catalog.GetString ("Exporting picture \"{0}\""), photo.Name));
							
					if (UserCancelled)
					 	break;
					 	
					file_info = new System.IO.FileInfo (photo.GetVersionPath(photo.DefaultVersionId));
//					orig_size = file_info.Length;

					// Prepare a tmp_mail file name
					FilterRequest request = new FilterRequest (photo.DefaultVersionUri);

					filters.Convert (request);
					request.Preserve(request.Current);

 					mail_attach.Append(attach_arg.ToString() + System.Web.HttpUtility.UrlEncode (request.Current.ToString()));
					
					// Mark the path for deletion
					tmp_paths.Add (request.Current.LocalPath);

					// Update the running total of the actual file sizes.
					file_info = new System.IO.FileInfo (request.Current.LocalPath);
					new_size = file_info.Length;
					actual_total_size += new_size;

					// Update dialog to indicate Actual size!
					// This is currently disabled, since the dialog box is not visible at this stage.
					// string approxresult = SizeUtil.ToHumanReadable (actual_total_size);
					// ActualMailSize.Text = approxresult;	


					//System.Console.WriteLine ("Orig file size {0}, New file size {1}, % {4}, Scaled to size {2}, new name {3}", 
					//orig_size, new_size, size, tmp_path, 1 - ((orig_size-new_size)/orig_size));
				}
			} // foreach
			
			if (progress_dialog != null) 
				progress_dialog.Destroy (); // No need to keep this window

			if (UserCancelled)
				DeleteTempFile();
			else {		
				// Send the mail :)
				switch (Preferences.Get (Preferences.GNOME_MAILTO_COMMAND) as string) {
					// openSuSE
					case "thunderbird %s":
						System.Diagnostics.Process.Start("thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
					break;
					case "icedove %s":
						System.Diagnostics.Process.Start("thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
					break;
					case "mozilla-thunderbird %s":
						System.Diagnostics.Process.Start("mozilla-thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
					break;
					case "seamonkey -mail -compose %s":
						System.Diagnostics.Process.Start("seamonkey", " -mail -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
					break;
					case "kmail %s":
						System.Diagnostics.Process.Start("kmail", "  --composer --subject \"my photos\"" + mail_attach);
					break;
					default: 
						GnomeUtil.UrlShow (parent_window,"mailto:?subject=my%20photos" + mail_attach);
					break;
				}
				                
				// Check if we have any temporary files to be deleted
				if (tmp_paths.Count > 0) {
					// Fetch timeout value from preferences. In seconds. Needs to be multiplied with 1000 to get msec
					uint delete_timeout;
					delete_timeout = (uint) ( (int) Preferences.Get (Preferences.EXPORT_EMAIL_DELETE_TIMEOUT_SEC) );
					delete_timeout = delete_timeout * 1000; // to get milliseconds.

					// Start a timer and when it occurs, delete the temp files.
					GLib.Timeout.Add (delete_timeout, new GLib.TimeoutHandler (DeleteTempFile));
				}
			}
		}
		private void HandleResponse (object sender, Gtk.ResponseArgs args)
		{
			if (args.ResponseId != Gtk.ResponseType.Ok) {
				// FIXME this is to work around a bug in gtk+ where
				// the filesystem events are still listened to when
				// a FileChooserButton is destroyed but not finalized
				// and an event comes in that wants to update the child widgets.
				Dialog.Destroy ();
				uri_chooser.Dispose ();
				uri_chooser = null;
				return;
			}

			dest = new Gnome.Vfs.Uri (uri_chooser.Uri);
			open = open_check.Active;
			scale = scale_check.Active;
			rotate = rotate_check.Active;
			exportTags = export_tags_check.Active;
			exportTagIcons = export_tag_icons_check.Active;

			gallery_name = name_entry.Text;

			if (description_entry != null)
				description = description_entry.Text;

			if (scale)
				size = size_spin.ValueAsInt;

			command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
			command_thread.Name = Catalog.GetString ("Transferring Pictures");

			//FIXME: get the files/dirs count in a cleaner way than (* 5 + 2(zip) + 9)
			// selection * 5 (original, mq, lq, thumbs, comments)
			// 2: zipfiles
			// 9: directories + info.txt + .htaccess
			// this should actually be 1 anyway, because we transfer just one dir
			progress_dialog = new FSpot.ThreadProgressDialog (command_thread, 1);
			progress_dialog.Start ();
		}
Ejemplo n.º 9
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            long new_size = 0;
//			long orig_size = 0;
            long actual_total_size = 0;
            int  size = 0;

            System.IO.FileInfo file_info;
            bool UserCancelled = false;
            bool rotate        = true;

            // Lets remove the mail "create mail" dialog
            Dialog.Destroy();

            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                return;
            }
            ProgressDialog progress_dialog = null;

            actual_total_size = 0;

            progress_dialog = new ProgressDialog(Catalog.GetString("Preparing email"),
                                                 ProgressDialog.CancelButtonType.Stop,
                                                 selection.Items.Length,
                                                 parent_window);

            size = GetScaleSize();             // Which size should we scale to. 0 --> Original

            // evaluate mailto command and define attachment args for cli
            System.Text.StringBuilder attach_arg = new System.Text.StringBuilder();
            switch (Preferences.Get(Preferences.GNOME_MAILTO_COMMAND) as string)
            {
            case "thunderbird %s":
            case "mozilla-thunderbird %s":
            case "seamonkey -mail -compose %s":
            case "icedove %s":
                attach_arg.Append(",");
                break;

            case "kmail %s":
                attach_arg.Append(" --attach ");
                break;

            default:                      //evolution falls into default, since it supports mailto uri correctly
                attach_arg.Append("&attach=");
                break;
            }

            rotate = rotate_check.Active;              // Should we automatically rotate original photos.
            Preferences.Set(Preferences.EXPORT_EMAIL_ROTATE, rotate);

            // Initiate storage for temporary files to be deleted later
            tmp_paths = new System.Collections.ArrayList();

            // Create a tmp directory.
            tmp_mail_dir = System.IO.Path.GetTempFileName();                    // Create a tmp file
            System.IO.File.Delete(tmp_mail_dir);                                // Delete above tmp file
            System.IO.Directory.CreateDirectory(tmp_mail_dir);                  // Create a directory with above tmp name

            System.Text.StringBuilder mail_attach = new System.Text.StringBuilder();

            FilterSet filters = new FilterSet();

            if (size != 0)
            {
                filters.Add(new ResizeFilter((uint)size));
            }
            else if (rotate)
            {
                filters.Add(new OrientationFilter());
            }
            filters.Add(new UniqueNameFilter(tmp_mail_dir));


            foreach (Photo photo in selection.Items)
            {
                if ((photo != null) && (!UserCancelled))
                {
                    if (progress_dialog != null)
                    {
                        UserCancelled = progress_dialog.Update(String.Format
                                                                   (Catalog.GetString("Exporting picture \"{0}\""), photo.Name));
                    }

                    if (UserCancelled)
                    {
                        break;
                    }

                    file_info = new System.IO.FileInfo(photo.GetVersionPath(photo.DefaultVersionId));
//					orig_size = file_info.Length;

                    // Prepare a tmp_mail file name
                    FilterRequest request = new FilterRequest(photo.DefaultVersionUri);

                    filters.Convert(request);
                    request.Preserve(request.Current);

                    mail_attach.Append(attach_arg.ToString() + System.Web.HttpUtility.UrlEncode(request.Current.ToString()));

                    // Mark the path for deletion
                    tmp_paths.Add(request.Current.LocalPath);

                    // Update the running total of the actual file sizes.
                    file_info          = new System.IO.FileInfo(request.Current.LocalPath);
                    new_size           = file_info.Length;
                    actual_total_size += new_size;

                    // Update dialog to indicate Actual size!
                    // This is currently disabled, since the dialog box is not visible at this stage.
                    // string approxresult = SizeUtil.ToHumanReadable (actual_total_size);
                    // ActualMailSize.Text = approxresult;


                    //System.Console.WriteLine ("Orig file size {0}, New file size {1}, % {4}, Scaled to size {2}, new name {3}",
                    //orig_size, new_size, size, tmp_path, 1 - ((orig_size-new_size)/orig_size));
                }
            }             // foreach

            if (progress_dialog != null)
            {
                progress_dialog.Destroy();                  // No need to keep this window
            }
            if (UserCancelled)
            {
                DeleteTempFile();
            }
            else
            {
                // Send the mail :)
                switch (Preferences.Get(Preferences.GNOME_MAILTO_COMMAND) as string)
                {
                // openSuSE
                case "thunderbird %s":
                    System.Diagnostics.Process.Start("thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
                    break;

                case "icedove %s":
                    System.Diagnostics.Process.Start("thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
                    break;

                case "mozilla-thunderbird %s":
                    System.Diagnostics.Process.Start("mozilla-thunderbird", " -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
                    break;

                case "seamonkey -mail -compose %s":
                    System.Diagnostics.Process.Start("seamonkey", " -mail -compose \"subject=my photos,attachment='" + mail_attach + "'\"");
                    break;

                case "kmail %s":
                    System.Diagnostics.Process.Start("kmail", "  --composer --subject \"my photos\"" + mail_attach);
                    break;

                default:
                    GnomeUtil.UrlShow(parent_window, "mailto:?subject=my%20photos" + mail_attach);
                    break;
                }

                // Check if we have any temporary files to be deleted
                if (tmp_paths.Count > 0)
                {
                    // Fetch timeout value from preferences. In seconds. Needs to be multiplied with 1000 to get msec
                    uint delete_timeout;
                    delete_timeout = (uint)((int)Preferences.Get(Preferences.EXPORT_EMAIL_DELETE_TIMEOUT_SEC));
                    delete_timeout = delete_timeout * 1000;                     // to get milliseconds.

                    // Start a timer and when it occurs, delete the temp files.
                    GLib.Timeout.Add(delete_timeout, new GLib.TimeoutHandler(DeleteTempFile));
                }
            }
        }
		private void HandleResponse (object sender, Gtk.ResponseArgs args)
		{
			if (args.ResponseId != Gtk.ResponseType.Ok) {
				Dialog.Destroy ();
				return;
			}

			if (account != null) {
				Dialog.Hide ();

				command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
				command_thread.Name = Mono.Unix.Catalog.GetString ("Uploading Pictures");

				progress_dialog = new FSpot.ThreadProgressDialog (command_thread, items.Length);
				progress_dialog.Start ();
			}
		}
Ejemplo n.º 11
0
		private void HandleResponse (object sender, Gtk.ResponseArgs args)
		{
			if (args.ResponseId != Gtk.ResponseType.Ok) {
				if (command_thread != null && command_thread.IsAlive)
					command_thread.Abort ();

				Dialog.Destroy ();
				return;
			}
			
			if (fr.CheckLogin() == null) {
				do_export_flickr.Sensitive = false;
				HigMessageDialog md = 
					new HigMessageDialog (Dialog, 
							      Gtk.DialogFlags.Modal |
							      Gtk.DialogFlags.DestroyWithParent,
							      Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
							      Catalog.GetString ("Unable to log on."),
							      string.Format (Catalog.GetString ("F-Spot was unable to log on to {0}.  Make sure you have given the authentication using {0} web browser interface."),
							      		     current_service.Name));
				md.Run ();
				md.Destroy ();
				return;
			}

			fr.ExportTags = tag_check.Active;
			open = open_check.Active;
			scale = scale_check.Active;
			copy_metadata = !meta_check.Active;
			is_public = public_radio.Active;
			is_family = family_check.Active;
			is_friend = friend_check.Active;
			if (scale)
				size = size_spin.ValueAsInt;

			command_thread = new Thread (new ThreadStart (Upload));
			command_thread.Name = Catalog.GetString ("Uploading Pictures");
			
			Dialog.Destroy ();
			progress_dialog = new FSpot.ThreadProgressDialog (command_thread, selection.Count);
			progress_dialog.Start ();
			
			// Save these settings for next time
			Preferences.Set (Preferences.EXPORT_FLICKR_SCALE, scale);
			Preferences.Set (Preferences.EXPORT_FLICKR_SIZE, size);
			Preferences.Set (Preferences.EXPORT_FLICKR_BROWSER, open);
			Preferences.Set (Preferences.EXPORT_FLICKR_TAGS, tag_check.Active);
			Preferences.Set (Preferences.EXPORT_FLICKR_STRIP_META, meta_check.Active);
			Preferences.Set (Preferences.EXPORT_FLICKR_PUBLIC, public_radio.Active);
			Preferences.Set (Preferences.EXPORT_FLICKR_FAMILY, family_check.Active);
			Preferences.Set (Preferences.EXPORT_FLICKR_FRIENDS, friend_check.Active);
			Preferences.Set (current_service.PreferencePath, fr.Token);
		}