Example #1
0
        public RatingFilterDialog(FSpot.PhotoQuery query, Gtk.Window parent_window)
            : base("RatingFilterDialog.ui", "rating_filter_dialog")
        {
            TransientFor    = parent_window;
            DefaultResponse = ResponseType.Ok;
            ok_button.GrabFocus();

            if (query.RatingRange != null)
            {
                minrating_value = (int)query.RatingRange.MinRating;
                maxrating_value = (int)query.RatingRange.MaxRating;
            }
            minrating = new RatingEntry(minrating_value);
            maxrating = new RatingEntry(maxrating_value);
            minrating_hbox.PackStart(minrating, false, false, 0);
            maxrating_hbox.PackStart(maxrating, false, false, 0);

            minrating.Show();
            maxrating.Show();

            minrating.Changed += HandleMinratingChanged;
            maxrating.Changed += HandleMaxratingChanged;

            ResponseType response = (ResponseType)Run();

            if (response == ResponseType.Ok)
            {
                query.RatingRange = new RatingRange((uint)minrating.Value, (uint)maxrating.Value);
            }

            Destroy();
        }
Example #2
0
        protected ColorDialog(FSpot.PhotoQuery query, int item)
        {
            view = new FSpot.PhotoImageView(query);
            view_scrolled.Add(view);
            view.Show();
            view.Item.Index = item;

            this.CreateDialog("external_color_dialog");
            AttachInterface();
        }
Example #3
0
        public LastRolls(FSpot.PhotoQuery query, RollStore rollstore, Gtk.Window parent_window) : base("last_import_rolls_filter")
        {
            this.query         = query;
            this.rollstore     = rollstore;
            this.parent_window = parent_window;
            rolls = rollstore.GetRolls(FSpot.Preferences.Get <int> (FSpot.Preferences.IMPORT_GUI_ROLL_HISTORY));

            PopulateCombos();

            combo_filter.Active = 0;
            combo_roll_1.Active = 0;
            combo_roll_2.Active = 0;

            Dialog.DefaultResponse = ResponseType.Ok;
            Dialog.Response       += HandleResponse;
            Dialog.Show();
        }
		public LastRolls (FSpot.PhotoQuery query, RollStore rollstore, Gtk.Window parent_window) : base ("last_import_rolls_filter") 
		{
			this.query = query;
			this.rollstore = rollstore;
			this.parent_window = parent_window;
			rolls = rollstore.GetRolls (FSpot.Preferences.Get<int> (FSpot.Preferences.IMPORT_GUI_ROLL_HISTORY));

			PopulateCombos ();
			
			combo_filter.Active = 0;
			combo_roll_1.Active = 0;
			combo_roll_2.Active = 0;
			
			Dialog.DefaultResponse = ResponseType.Ok;
			Dialog.Response += HandleResponse;
			Dialog.Show ();
		}
Example #5
0
#pragma warning restore 649

        public LastRolls(FSpot.PhotoQuery query, RollStore rollstore, Window parent) : base("LastImportRollFilterDialog.ui", "last_import_rolls_filter")
        {
            this.query     = query;
            this.rollstore = rollstore;
            rolls          = rollstore.GetRolls(Preferences.Get <int> (Preferences.IMPORT_GUI_ROLL_HISTORY));

            TransientFor = parent;

            PopulateCombos();

            combo_filter.Active = 0;
            combo_roll_1.Active = 0;
            combo_roll_2.Active = 0;

            DefaultResponse = ResponseType.Ok;
            Response       += HandleResponse;
            Show();
        }
        public LastRolls(FSpot.PhotoQuery query, RollStore rollstore, Window parent)
            : base("LastImportRollFilterDialog.ui", "last_import_rolls_filter")
        {
            this.query = query;
            this.rollstore = rollstore;
            rolls = rollstore.GetRolls (FSpot.Preferences.Get<int> (FSpot.Preferences.IMPORT_GUI_ROLL_HISTORY));

            TransientFor = parent;

            PopulateCombos ();

            combo_filter.Active = 0;
            combo_roll_1.Active = 0;
            combo_roll_2.Active = 0;

            DefaultResponse = ResponseType.Ok;
            Response += HandleResponse;
            Show ();
        }
Example #7
0
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window)
            : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            this.db = db;
            TransientFor = parent_window;
            Title = String.Format (Catalog.GetString ("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
                preview_image.Pixbuf = preview_pixbuf.Copy ();
                ColorManagement.ApplyProfile (preview_image.Pixbuf, screen_profile);
            } else
                preview_image.Pixbuf = preview_pixbuf;

            query = new FSpot.PhotoQuery (db.Photos);

            if (db.Tags.Hidden != null)
                query.Terms = FSpot.OrTerm.FromTags (new Tag [] {t});
            else
                query.Terms = new FSpot.Literal (t);

            image_view = new PhotoImageView (query) {CropHelpers = false};
            image_view.SelectionXyRatio = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton (Catalog.GetString ("Select Photo from file"),
                    Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
                        external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart (external_photo_chooser);
            external_photo_chooser.Show ();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add (image_view);

            if (query.Count > 0) {
                photo_spin_button.Wrap = true;
                photo_spin_button.Adjustment.Lower = 1.0;
                photo_spin_button.Adjustment.Upper = (double) query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            } else {
                from_photo_label.Markup = String.Format (Catalog.GetString (
                    "\n<b>From Photo</b>\n" +
                    " You can use one of your library photos as an icon for this tag.\n" +
                    " However, first you must have at least one photo associated\n" +
                    " with this tag. Please tag a photo as '{0}' and return here\n" +
                    " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible = false;
                photo_spin_button.Visible = false;
            }

            icon_store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));

            icon_view = new Gtk.IconView (icon_store);
            icon_view.PixbufColumn = 1;
            icon_view.SelectionMode = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add (icon_view);

            icon_view.Show();

            image_view.Show ();

            FSpot.Delay fill_delay = new FSpot.Delay (FillIconView);
            fill_delay.Start ();
        }
        public EditTagIconDialog(Db db, Tag t, Gtk.Window parent_window) : base("EditTagIconDialog.ui", "edit_tag_icon_dialog")
        {
            TransientFor = parent_window;
            Title        = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            preview_pixbuf = t.Icon;
            Cms.Profile screen_profile;
            if (preview_pixbuf != null && FSpot.ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile))
            {
                preview_image.Pixbuf = preview_pixbuf.Copy();
                ColorManagement.ApplyProfile(preview_image.Pixbuf, screen_profile);
            }
            else
            {
                preview_image.Pixbuf = preview_pixbuf;
            }

            query = new FSpot.PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = FSpot.OrTerm.FromTags(new Tag [] { t });
            }
            else
            {
                query.Terms = new FSpot.Literal(t);
            }

            image_view = new PhotoImageView(query)
            {
                CropHelpers = false
            };
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);
            external_photo_chooser.Show();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            DelayedOperation fill_delay = new DelayedOperation(FillIconView);

            fill_delay.Start();
        }