Files
OpenNest/OpenNest/Forms/DrawingSetsForm.cs
T
ajandClaude Opus 5.5 1fc36e9e54 feat(desktop): open drawing sets from File without a nest
Releasing a set creates new nests or merges into draft ones, so tying the
set browser to the Drawing Library dialog (which needs an open nest) put it
behind a document it never uses. File > Drawing Sets... (Database mode)
now opens a standalone window with the set browser and Release, opening
released nests in their own tabs. The library dialog loses its Sets tab
but keeps Used in Sets and Add to Set on a drawing's menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:37:04 -04:00

35 lines
1.4 KiB
C#

using System;
using System.Windows.Forms;
using OpenNest.Data;
namespace OpenNest.Forms
{
/// <summary>
/// File &gt; Drawing Sets (Database mode): browses, edits and releases the server's drawing
/// sets with <see cref="Controls.DrawingSetBrowser"/>. It needs no open nest, since a
/// release creates new nests or merges into draft ones and opens each in its own tab.
/// </summary>
public partial class DrawingSetsForm : Form
{
internal OpenNest.Controls.DrawingSetBrowser Browser => browser;
/// <param name="library">Used by the set editor to pick drawings.</param>
public DrawingSetsForm(IDrawingSetStore sets, IDrawingLibraryStore library, string serverUrl)
{
InitializeComponent();
browser.Initialize(sets, library, serverUrl);
Text = $"Drawing Sets — {serverUrl}";
}
/// <summary>
/// Shows Release: nests are saved through <paramref name="nests"/> and each is opened
/// with <paramref name="openNest"/>; a nest <paramref name="isNestOpen"/> reports as open
/// in a tab is never merged into.
/// </summary>
public void EnableRelease(INestRepository nests, Action<Nest, NestRecord> openNest, Func<Guid, bool> isNestOpen = null) =>
browser.EnableRelease(nests, openNest, isNestOpen);
private async void DrawingSetsForm_Shown(object sender, EventArgs e) => await browser.RefreshAsync();
}
}