示例#1
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();
        }
示例#2
0
        void HandleOkClicked(object sender, EventArgs args)
        {
            Hide();
            dialog.Hide();

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

            progressDialog = new ThreadProgressDialog(command_thread, 1);
            progressDialog.Start();
        }
示例#3
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;
            export_tag = tag_check.Active;

            if (account != null)
            {
                album       = (PicasaAlbum)account.Picasa.GetAlbums() [Math.Max(0, album_optionmenu.Active)];
                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 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 (Preferences.EXPORT_GALLERY_META, meta);
                Preferences.Set(TAG_KEY, export_tag);
            }
        }
示例#4
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);
            }
        }
示例#5
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();
        }
示例#6
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();
        }
示例#7
0
        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           = GLib.FileFactory.NewForUri(uri_chooser.Uri);
            open           = open_check.Active;
            scale          = scale_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("Exporting Photos");

            progress_dialog = new ThreadProgressDialog(command_thread, 1);
            progress_dialog.Start();
        }
示例#8
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(oauth_verification_code.Text) == 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.Token);
            Preferences.Set(current_service.PreferencePath + "secret", fr.Token.TokenSecret);
            Preferences.Set(current_service.PreferencePath + "userId", fr.Token.UserId);
            Preferences.Set(current_service.PreferencePath + "userName", fr.Token.Username);
        }
示例#9
0
        public void Run(IBrowsableCollection selection)
        {
            this.selection = selection;
            dialog = new CDExportDialog (selection, dest);
            //LoadHistory ();

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

            clean = dialog.Clean;
            rotate = dialog.Rotate;

            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 ();
        }
示例#10
0
        public void Run(IBrowsableCollection selection)
        {
            dialog = new FacebookExportDialog(selection);

            if (selection.Items.Count() > 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.Count());
                progress_dialog.Start();
            }

            dialog.Destroy();
        }
示例#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;
            fr.ExportTagHierarchy = hierarchy_check.Active;
            fr.ExportIgnoreTopLevel = ignore_top_level_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 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 (STRIP_META_KEY, meta_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);
        }
示例#12
0
        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 ThreadProgressDialog (command_thread, 1);
            progress_dialog.Start ();
        }
        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 ();
        }
示例#14
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) {
                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 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);
            }
        }
示例#15
0
        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 = GLib.FileFactory.NewForUri (uri_chooser.Uri);
            open = open_check.Active;
            scale = scale_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 ("Exporting Photos");

            progress_dialog = new ThreadProgressDialog (command_thread, 1);
            progress_dialog.Start ();
        }
示例#16
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;
            rotate = rotate_check.Active;

            if (account != null) {
                //System.Console.WriteLine ("history = {0}", album_optionmenu.History);
                album = (Album) account.Gallery.Albums [Math.Max (0, album_optionmenu.History)];
                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);
                Preferences.Set (ROTATE_KEY, rotate);
            }
        }
        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 ();
        }
示例#18
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.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 ();
        }
示例#19
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;

            if (account != null) {
                album = (Album) account.SmugMug.GetAlbums() [Math.Max (0, album_optionmenu.Active)];
                photo_index = 0;

                Dialog.Destroy ();

                command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (this.Upload));
                command_thread.Name = Mono.Unix.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);
            }
        }
        private bool SaveFiles()
        {
            index_list = GetSelectedItems ();
            this.Dialog.Hide ();

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

            progress_dialog = new ThreadProgressDialog (command_thread, 1);
            progress_dialog.Start ();

            while (command_thread.IsAlive) {
                if (Application.EventsPending ())
                    Application.RunIteration ();

            }

            return true;
        }