예제 #1
0
    public PhotoVersionMenu(IPhoto photo)
    {
        Version = photo.DefaultVersion;

        version_mapping = new Dictionary <MenuItem, IPhotoVersion> ();

        foreach (IPhotoVersion version in photo.Versions)
        {
            MenuItem menu_item = new MenuItem(version.Name);
            menu_item.Show();
            menu_item.Sensitive = true;
            Gtk.Label child = ((Gtk.Label)menu_item.Child);

            if (version == photo.DefaultVersion)
            {
                child.UseMarkup = true;
                child.Markup    = String.Format("<b>{0}</b>", version.Name);
            }

            version_mapping.Add(menu_item, version);

            Append(menu_item);
        }

        if (version_mapping.Count == 1)
        {
            MenuItem no_edits_menu_item = new MenuItem(Mono.Unix.Catalog.GetString("(No Edits)"));
            no_edits_menu_item.Show();
            no_edits_menu_item.Sensitive = false;
            Append(no_edits_menu_item);
        }
    }
예제 #2
0
    public PhotoVersionMenu(IPhoto photo)
    {
        Version = photo.DefaultVersion;

        versionMapping = new Dictionary <MenuItem, IPhotoVersion> ();

        foreach (var version in photo.Versions)
        {
            var menu_item = new MenuItem(version.Name);
            menu_item.Show();
            menu_item.Sensitive = true;
            var child = ((Gtk.Label)menu_item.Child);

            if (version == photo.DefaultVersion)
            {
                child.UseMarkup = true;
                child.Markup    = $"<b>{version.Name}</b>";
            }

            versionMapping.Add(menu_item, version);

            Append(menu_item);
        }

        if (versionMapping.Count == 1)
        {
            var no_edits_menu_item = new MenuItem(Strings.ParenNoEditsParen);
            no_edits_menu_item.Show();
            no_edits_menu_item.Sensitive = false;
            Append(no_edits_menu_item);
        }
    }
예제 #3
0
 void HandleVersionChanged(InfoBox box, IPhotoVersion version)
 {
     if (item.Current is IPhotoVersionable versionable && item.Collection is PhotoQuery q)
     {
         versionable.SetDefaultVersion(version);
         q.Commit(item.Index);
     }
 }
예제 #4
0
 void HandleMenuItemActivated(object sender, EventArgs args)
 {
     if (sender is MenuItem item && versionMapping.ContainsKey(item))
     {
         Version = versionMapping[item];
         VersionChanged(this);
     }
 }
예제 #5
0
        public void SetDefaultVersion(IPhotoVersion version)
        {
            if (!(version is PhotoVersion photoVersion))
            {
                throw new ArgumentException("Not a valid version for this photo");
            }

            DefaultVersionId = photoVersion.VersionId;
        }
예제 #6
0
        private void HandleVersionChanged(InfoBox box, IPhotoVersion version)
        {
            IPhotoVersionable versionable = item.Current as IPhotoVersionable;
            PhotoQuery q = item.Collection as PhotoQuery;

            if (versionable != null && q != null) {
                versionable.SetDefaultVersion (version);
                q.Commit (item.Index);
            }
        }
예제 #7
0
    // XXX: never called
    private void HandleMenuItemActivated(object sender, EventArgs args)
    {
        MenuItem item = sender as MenuItem;

        if (item != null && version_mapping.ContainsKey(item))
        {
            Version = version_mapping [item];
            VersionChanged(this);
        }
    }
예제 #8
0
파일: Photo.cs 프로젝트: swgshaw/f-spot
        public void SetDefaultVersion(IPhotoVersion version)
        {
            PhotoVersion photo_version = version as PhotoVersion;

            if (photo_version == null)
            {
                throw new ArgumentException("Not a valid version for this photo");
            }

            DefaultVersionId = photo_version.VersionId;
        }
예제 #9
0
        private void HandleVersionChanged(InfoBox box, IPhotoVersion version)
        {
            IPhotoVersionable versionable = item.Current as IPhotoVersionable;
            PhotoQuery        q           = item.Collection as PhotoQuery;

            if (versionable != null && q != null)
            {
                versionable.SetDefaultVersion(version);
                q.Commit(item.Index);
            }
        }
예제 #10
0
파일: Photo.cs 프로젝트: Yetangitu/f-spot
        public void SetDefaultVersion(IPhotoVersion version)
        {
            PhotoVersion photo_version = version as PhotoVersion;
            if (photo_version == null)
                throw new ArgumentException ("Not a valid version for this photo");

            DefaultVersionId = photo_version.VersionId;
        }
예제 #11
0
파일: MainWindow.cs 프로젝트: mono/f-spot
		// Version Id updates.

		void UpdateForVersionChange (IPhotoVersion version)
		{
			IPhotoVersionable versionable = CurrentPhoto;

			if (versionable != null) {
				versionable.SetDefaultVersion (version);
				query.Commit (ActiveIndex ());
			}
		}
    private void HandleMenuItemActivated(object sender, EventArgs args)
    {
        MenuItem item = sender as MenuItem;

        if (item != null && version_mapping.ContainsKey (item)) {
            Version = version_mapping [item];
            VersionChanged (this);
        }
    }