示例#1
0
        private void HandleResponse(object sender,
		                             Gtk.ResponseArgs args)
        {
            main_dialog.Destroy ();

            if (Gtk.ResponseType.Ok != args.ResponseId) {
                Log.Information ("Tabblo export was canceled.");
                return;
            }

            model.Serialize ();

            Log.Information ("Starting Tabblo export");

            Thread upload_thread =
                    new Thread (new ThreadStart (Upload));
            progress_dialog = new ThreadProgressDialog (
                    upload_thread, model.Photos.Length);
            progress_dialog.Start ();
        }
示例#2
0
        public void Run(IBrowsableCollection selection)
        {
            this.selection = selection;
            dialog = new CDExportDialog (selection, dest);

            if (dialog.Run () != (int)ResponseType.Ok) {
                dialog.Destroy ();
                return;
            }

            clean = dialog.RemovePreviousPhotos;

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

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

            dialog.Destroy ();
        }
示例#3
0
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            if (args.ResponseId != Gtk.ResponseType.Ok) {
                export_dialog.Destroy ();
                return;
            }

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

            browser = browser_check.Active;
            meta = meta_check.Active;

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

                export_dialog.Destroy ();

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

                progress_dialog = new 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 (BROWSER_KEY, browser);
                Preferences.Set (META_KEY, meta);
            }
        }
示例#4
0
        public void Run(IBrowsableCollection selection)
        {
            dialog = new FacebookExportDialog (selection);

            if (selection.Items.Length > max_photos_per_album) {
                HigMessageDialog mbox = new HigMessageDialog (dialog,
                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
                        Gtk.ButtonsType.Ok, Catalog.GetString ("Too many images to export"),
                        String.Format (Catalog.GetString ("Facebook only permits {0} photographs per album.  Please refine your selection and try again."), max_photos_per_album));
                mbox.Run ();
                mbox.Destroy ();
                return;
            }

            if (dialog.Run () != (int)ResponseType.Ok) {
                dialog.Destroy ();
                return;
            }

            if (dialog.CreateAlbum) {
                string name = dialog.AlbumName;
                if (String.IsNullOrEmpty (name)) {
                    HigMessageDialog mbox = new HigMessageDialog (dialog, Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString ("Album must have a name"),
                            Catalog.GetString ("Please name your album or choose an existing album."));
                    mbox.Run ();
                    mbox.Destroy ();
                    return;
                }

                string description = dialog.AlbumDescription;
                string location = dialog.AlbumLocation;

                try {
                    album = dialog.Account.Facebook.CreateAlbum (name, description, location);
                }
                catch (FacebookException fe) {
                    HigMessageDialog mbox = new HigMessageDialog (dialog, Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString ("Creating a new album failed"),
                            String.Format (Catalog.GetString ("An error occurred creating a new album.\n\n{0}"), fe.Message));
                    mbox.Run ();
                    mbox.Destroy ();
                    return;
                }
            } else {
                album = dialog.ActiveAlbum;
            }

            if (dialog.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 ThreadProgressDialog (command_thread, selection.Items.Length);
                progress_dialog.Start ();
            }

            dialog.Destroy ();
        }
示例#5
0
        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;
                var 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;
            fr.ExportTagHierarchy = hierarchy_check.Active;
            fr.ExportIgnoreTopLevel = ignore_top_level_check.Active;
            open = open_check.Active;
            scale = scale_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 ThreadProgressDialog (command_thread, selection.Count);
            progress_dialog.Start ();

            // Save these settings for next time
            Preferences.Set (SCALE_KEY, scale);
            Preferences.Set (SIZE_KEY, size);
            Preferences.Set (BROWSER_KEY, open);
            Preferences.Set (TAGS_KEY, tag_check.Active);
            Preferences.Set (PUBLIC_KEY, public_radio.Active);
            Preferences.Set (FAMILY_KEY, family_check.Active);
            Preferences.Set (FRIENDS_KEY, friend_check.Active);
            Preferences.Set (TAG_HIERARCHY_KEY, hierarchy_check.Active);
            Preferences.Set (IGNORE_TOP_LEVEL_KEY, ignore_top_level_check.Active);
            Preferences.Set (current_service.PreferencePath, fr.Token);
        }
示例#6
0
        private void HandleOkClicked(object sender, EventArgs args)
        {
            this.Hide ();
            dialog.Hide ();

            System.Threading.Thread command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (doSharpening));
            command_thread.Name = "Sharpening";

            progressDialog = new ThreadProgressDialog (command_thread, 1);
            progressDialog.Start ();
        }
示例#7
0
文件: Phomo.cs 项目: petergtz/phomo
		void on_dialog_response (object obj, ResponseArgs args) {
			if (args.ResponseId == ResponseType.Ok) {
				config = save_controls();
				System.Threading.Thread command_thread = new System.Threading.Thread (createMosaics);
				command_thread.Name = Catalog.GetString ("Creating Photomosaic");
				progress_dialog = new FSpot.UI.Dialog.ThreadProgressDialog (command_thread, 1);
				progress_dialog.Response += HandleProgressAbort;
				progress_dialog.Start ();
			}
			dialog.Destroy ();
		}