GUI 도 dsm.config.ini 자동 로드
- 대상 폴더(→ exe 폴더)에 dsm.config.ini 가 있으면 자동으로 읽어 화면 옵션에 반영 (폴더 선택 시 / 생성 시 자동 탐색, 이미 적용한 파일은 재로드 안 함) - [설정(ini) 불러오기…] 버튼으로 임의 경로의 ini 선택 가능 - ini 의 samplemarker 등 UI 에 없는 값도 실행에 반영 이전엔 GUI 가 ini 를 무시해 기본값(엔진 미제외)으로 동작 → 엔진이 포함되던 문제 해결 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -30,6 +30,7 @@
|
|||||||
<CheckBox x:Name="AutoInternalBox" IsChecked="True" Content="내부 NuGet 자동감지" Margin="0,0,16,4"/>
|
<CheckBox x:Name="AutoInternalBox" IsChecked="True" Content="내부 NuGet 자동감지" Margin="0,0,16,4"/>
|
||||||
<CheckBox x:Name="FollowBox" IsChecked="True" Content="루트 밖 프로젝트 따라가기" Margin="0,0,16,4"/>
|
<CheckBox x:Name="FollowBox" IsChecked="True" Content="루트 밖 프로젝트 따라가기" Margin="0,0,16,4"/>
|
||||||
<CheckBox x:Name="ExtDllBox" IsChecked="True" Content="외부 DLL 포함" Margin="0,0,16,4"/>
|
<CheckBox x:Name="ExtDllBox" IsChecked="True" Content="외부 DLL 포함" Margin="0,0,16,4"/>
|
||||||
|
<Button x:Name="LoadCfgBtn" Content="설정(ini) 불러오기…" Click="LoadConfig" Padding="8,2" Margin="0,0,16,4"/>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,4">
|
<StackPanel Orientation="Horizontal" Spacing="6" Margin="0,0,0,4">
|
||||||
<TextBlock Text="그룹:" VerticalAlignment="Center"/>
|
<TextBlock Text="그룹:" VerticalAlignment="Center"/>
|
||||||
<ComboBox x:Name="GroupCombo" Width="120" SelectedIndex="0">
|
<ComboBox x:Name="GroupCombo" Width="120" SelectedIndex="0">
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
private string? _lastHtml;
|
private string? _lastHtml;
|
||||||
private string? _lastOut;
|
private string? _lastOut;
|
||||||
|
private DsmConfig _loaded = new(); // 마지막으로 로드된 설정(SampleMarkers 등 UI에 없는 값 보관)
|
||||||
|
private string? _appliedIni; // 이미 적용한 ini 경로
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
@@ -32,13 +34,56 @@ public partial class MainWindow : Window
|
|||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
Log("대상 폴더가 현재 폴더로 지정되었습니다. 필요 시 변경 후 [생성] 을 누르세요.");
|
Log("대상 폴더가 현재 폴더로 지정되었습니다. 필요 시 변경 후 [생성] 을 누르세요.");
|
||||||
Log("팁: 대상 폴더에 dsm.config.ini 를 두면 팀별 설정이 자동 적용됩니다.");
|
Log("팁: 대상 폴더(또는 exe 폴더)에 dsm.config.ini 가 있으면 자동으로 읽어 적용합니다.");
|
||||||
|
TryAutoLoad(RootBox.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void BrowseRoot(object? s, Avalonia.Interactivity.RoutedEventArgs e)
|
private async void BrowseRoot(object? s, Avalonia.Interactivity.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var p = await PickFolder("분석할 대상 폴더 선택");
|
var p = await PickFolder("분석할 대상 폴더 선택");
|
||||||
if (p != null) RootBox.Text = p;
|
if (p != null) { RootBox.Text = p; TryAutoLoad(p); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// ini 자동 탐색·로드 (대상 폴더 → exe 폴더). 이미 적용한 파일이면 다시 안 함(사용자 수정 보존).
|
||||||
|
private void TryAutoLoad(string? root)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(root)) return;
|
||||||
|
var ini = Program.FindConfig(root.Trim().Trim('"'));
|
||||||
|
if (ini != null && !string.Equals(ini, _appliedIni, StringComparison.OrdinalIgnoreCase))
|
||||||
|
LoadConfigFile(ini);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void LoadConfig(object? s, Avalonia.Interactivity.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var top = GetTopLevel(this);
|
||||||
|
if (top is null) return;
|
||||||
|
var files = await top.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = "dsm.config.ini 선택",
|
||||||
|
AllowMultiple = false,
|
||||||
|
FileTypeFilter = new[] { new FilePickerFileType("설정 (*.ini)") { Patterns = new[] { "*.ini" } } }
|
||||||
|
});
|
||||||
|
if (files.Count > 0) { var p = files[0].TryGetLocalPath(); if (p != null) LoadConfigFile(p); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadConfigFile(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var c = DsmConfig.Load(path);
|
||||||
|
ExcludeBox.Text = string.Join(Environment.NewLine, c.ExcludePaths);
|
||||||
|
SamplesBox.IsChecked = c.ExcludeSamples;
|
||||||
|
AutoInternalBox.IsChecked = c.InternalAuto;
|
||||||
|
FollowBox.IsChecked = c.FollowExternal;
|
||||||
|
ExtDllBox.IsChecked = c.ExternalDlls;
|
||||||
|
ComponentBox.Text = string.Join(Environment.NewLine, c.ManualMap.Select(kv => $"{kv.Key} = {kv.Value}"));
|
||||||
|
foreach (var it in GroupCombo.Items)
|
||||||
|
if (it is ContentControl cc && string.Equals(cc.Content?.ToString(), c.GroupMode, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{ GroupCombo.SelectedItem = it; break; }
|
||||||
|
_loaded = c; _appliedIni = path;
|
||||||
|
Log("설정 적용됨: " + path);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { Log("설정 로드 실패: " + ex.Message); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void BrowseOut(object? s, Avalonia.Interactivity.RoutedEventArgs e)
|
private async void BrowseOut(object? s, Avalonia.Interactivity.RoutedEventArgs e)
|
||||||
@@ -67,6 +112,9 @@ public partial class MainWindow : Window
|
|||||||
var outDir = (OutBox.Text ?? "").Trim().Trim('"');
|
var outDir = (OutBox.Text ?? "").Trim().Trim('"');
|
||||||
if (string.IsNullOrWhiteSpace(outDir)) outDir = root;
|
if (string.IsNullOrWhiteSpace(outDir)) outDir = root;
|
||||||
|
|
||||||
|
// 대상 폴더에 dsm.config.ini 가 있으면(아직 미적용) 자동 로드
|
||||||
|
TryAutoLoad(root);
|
||||||
|
|
||||||
var cfg = new DsmConfig
|
var cfg = new DsmConfig
|
||||||
{
|
{
|
||||||
ExcludeSamples = SamplesBox.IsChecked == true,
|
ExcludeSamples = SamplesBox.IsChecked == true,
|
||||||
@@ -76,6 +124,7 @@ public partial class MainWindow : Window
|
|||||||
GroupMode = (GroupCombo.SelectedItem as ContentControl)?.Content?.ToString() ?? "auto",
|
GroupMode = (GroupCombo.SelectedItem as ContentControl)?.Content?.ToString() ?? "auto",
|
||||||
ExcludePaths = SplitLines(ExcludeBox.Text).Select(x => x.ToLowerInvariant()).ToList(),
|
ExcludePaths = SplitLines(ExcludeBox.Text).Select(x => x.ToLowerInvariant()).ToList(),
|
||||||
ManualMap = ParseMap(SplitLines(ComponentBox.Text)),
|
ManualMap = ParseMap(SplitLines(ComponentBox.Text)),
|
||||||
|
SampleMarkers = _loaded.SampleMarkers, // UI에 없는 값(ini의 samplemarker)은 로드된 설정에서
|
||||||
};
|
};
|
||||||
if (cfg.ExcludePaths.Count == 0) cfg.ExcludePaths = DsmConfig.DefaultExcludePaths.ToList();
|
if (cfg.ExcludePaths.Count == 0) cfg.ExcludePaths = DsmConfig.DefaultExcludePaths.ToList();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user